summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-08-06 14:40:56 -0400
committerOri Bernstein <ori@eigenstate.org>2017-08-06 14:40:56 -0400
commite4832da74d8722e6313a64db829473f4f5a3b3e6 (patch)
tree39dfbd87ed3f2860a35df9be8bb0c28f9e7c49b2 /support
parent241b498591ec1c86165c4e749f5e74ce7a03dd2a (diff)
downloadmc-e4832da74d8722e6313a64db829473f4f5a3b3e6.tar.gz
Bring back memfd.
Diffstat (limited to 'support')
-rw-r--r--support/syscall-gen/specials+linux-x64.frag5
1 files changed, 5 insertions, 0 deletions
diff --git a/support/syscall-gen/specials+linux-x64.frag b/support/syscall-gen/specials+linux-x64.frag
index 6160502..cf79018 100644
--- a/support/syscall-gen/specials+linux-x64.frag
+++ b/support/syscall-gen/specials+linux-x64.frag
@@ -1,3 +1,6 @@
+/* syscalls that aren't in freebsd's syscalls.master */
+const Sysmemfd_create : scno = 319
+
/* getting to the os */
extern const syscall : (sc:scno, args:... -> int64)
extern const sigreturn : (-> void)
@@ -49,6 +52,7 @@ const getcwd : (buf : byte[:] -> int64)
const sendmsg : (fd:fd, msg:msghdr#, flags:msgflags -> int64)
const recvmsg : (fd:fd, msg:msghdr#, flags:msgflags -> int64)
const fallocate : (fd:fd, mode:fallocmode, off:off, len:off -> int64)
+const memfdcreate : (name:byte[:], flags:mfdflags -> fd)
/* signals */
const sigaction : (sig : signo, act : sigaction#, oact : sigaction# -> int)
@@ -186,6 +190,7 @@ const getcwd = {buf; -> syscall(Sysgetcwd, a(buf), a(buf.len))}
const sendmsg = {fd, msg, flags; -> syscall(Syssendmsg, a(fd), msg, a(flags))}
const recvmsg = {fd, msg, flags; -> syscall(Sysrecvmsg, a(fd), msg, a(flags))}
const fallocate = {fd, mode, off, len; -> syscall(Sysfallocate, a(fd), a(mode), a(off), a(len))}
+const memfdcreate = {name, flags; -> (syscall(Sysmemfd_create, cstring(name), a(flags)) : fd)}
/* file stuff */
const pipe = {fds; -> syscall(Syspipe, a(fds))}