commit 46eb0f7b83a239a19445edbc2155c02609052461
parent 6801de052ae08a9ab188c117840a7528363b5d09
Author: Sebastian <sebastian@sebsite.pw>
Date: Mon, 10 Oct 2022 17:26:38 -0400
rt+linux: add memfd_create
Signed-off-by: Sebastian <sebastian@sebsite.pw>
Diffstat:
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/rt/+linux/syscalls.ha b/rt/+linux/syscalls.ha
@@ -834,6 +834,12 @@ export fn ptrace(
};
};
+
export fn sync() void = {
wrap_return(syscall0(SYS_sync))!;
};
+
+export fn memfd_create(name: *const char, flags: uint) (int | errno) = {
+ return wrap_return(syscall2(SYS_memfd_create,
+ name: uintptr: u64, flags: u64))?: int;
+};
diff --git a/rt/+linux/types.ha b/rt/+linux/types.ha
@@ -827,3 +827,7 @@ export type ptrace_syscall_info = struct {
export def STDIN_FILENO: int = 0;
export def STDOUT_FILENO: int = 1;
export def STDERR_FILENO: int = 2;
+
+export def MFD_CLOEXEC: uint = 1;
+export def MFD_ALLOW_SEALING: uint = 2;
+export def MFD_HUGETLB: uint = 4;