summaryrefslogtreecommitdiff
path: root/lib/sys
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2017-06-24 14:52:18 -0700
committerOri Bernstein <ori@eigenstate.org>2017-06-25 01:08:54 -0700
commit4c170a46ccb639cd901b593da3301c9ff4e583a6 (patch)
tree2623fe9068af4cde121f1a75a65afd325455b8c1 /lib/sys
parenta588eed92c2ce168e21c802f491674a71d03ce58 (diff)
downloadmc-4c170a46ccb639cd901b593da3301c9ff4e583a6.tar.gz
Add memfdcreate for linux-x64
Diffstat (limited to 'lib/sys')
-rw-r--r--lib/sys/sys+linux-x64.myr8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sys/sys+linux-x64.myr b/lib/sys/sys+linux-x64.myr
index e2a8aa0..627974b 100644
--- a/lib/sys/sys+linux-x64.myr
+++ b/lib/sys/sys+linux-x64.myr
@@ -35,6 +35,8 @@ pkg sys =
type fallocmode = uint32
+ type mfdflags = uint32
+
type clock = union
`Clockrealtime
`Clockmonotonic
@@ -433,6 +435,10 @@ pkg sys =
const Falloczerorange : fallocmode = 0x10
const Fallocinsertrange : fallocmode = 0x20
+ /* memfd flags */
+ const Mfdcloexec : mfdflags = 0x01
+ const Mfdallowsealing : mfdflags = 0x02
+
/* syscalls */
const Sysread : scno = 0
const Syswrite : scno = 1
@@ -817,6 +823,7 @@ pkg sys =
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)
@@ -950,6 +957,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))}