diff options
| author | Luna <git@l4.pm> | 2019-11-13 21:25:19 -0300 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-12-31 15:58:03 -0500 |
| commit | 997812e8fb9146360aa5200f0adbcd4863183287 (patch) | |
| tree | d4e32f9806a712ba9047a62482146c5475c252ba /lib/std/os/linux.zig | |
| parent | 25051832b37bab8d945e6284899a4c916ae00ada (diff) | |
| download | zig-997812e8fb9146360aa5200f0adbcd4863183287.tar.gz zig-997812e8fb9146360aa5200f0adbcd4863183287.zip | |
os: add memfd_create
currently only linux is supported
Diffstat (limited to 'lib/std/os/linux.zig')
| -rw-r--r-- | lib/std/os/linux.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig index d5bab64493..69e5b25f86 100644 --- a/lib/std/os/linux.zig +++ b/lib/std/os/linux.zig @@ -1110,6 +1110,10 @@ pub fn io_uring_register(fd: i32, opcode: u32, arg: ?*const c_void, nr_args: u32 return syscall4(SYS_io_uring_register, @bitCast(usize, @as(isize, fd)), opcode, @ptrToInt(arg), nr_args); } +pub fn memfd_create(name: [*:0]const u8, flags: usize) usize { + return syscall2(SYS_memfd_create, @ptrToInt(name), flags); +} + test "" { if (builtin.os == .linux) { _ = @import("linux/test.zig"); |
