From b1fb15a7e0152c8d49fe4d8cba1e6c534fce8400 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Sun, 20 Apr 2025 16:45:02 -0700 Subject: [PATCH] add munlockall --- mod.zig | 8 +++++++- test.zig | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mod.zig b/mod.zig index 8515021af2ec3450cde92d7bbc9eb3a716b38817..f18407b238d231220194c2bbe64ff7783b8b91a6 100644 --- a/mod.zig +++ b/mod.zig @@ -865,7 +865,13 @@ pub const mlockall = @compileError("TODO: mlockall"); // munlockall // int munlockall(void); // asmlinkage long sys_munlockall(void); -pub const munlockall = @compileError("TODO: munlockall"); +pub fn munlockall() errno.Error!c_int { + const r = syscall0(.munlockall); + return switch (_errno(r)) { + .ok => @intCast(r), + _ => |c| errno.errorFromInt(@intFromEnum(c)), + }; +} // vhangup // int vhangup(void); diff --git a/test.zig b/test.zig index 478db29e179388c80ac5380be1ba5185621f3876..52cb51db17fbec727d27262bb271cd9a6895aa53 100644 --- a/test.zig +++ b/test.zig @@ -19,4 +19,5 @@ test { _ = &linux.getppid; _ = &linux.getpgrp; _ = &linux.setsid; + _ = &linux.munlockall; } -- 2.54.0