summaryrefslogtreecommitdiff
path: root/src/linux
diff options
context:
space:
mode:
authorSzabolcs Nagy <nsz@port70.net>2018-06-19 20:28:03 +0000
committerRich Felker <dalias@aerifal.cx>2018-06-20 21:36:04 -0400
commit38f2fa3d0207b8060302129c6464662751d4f2d3 (patch)
tree72457eacc9c5ebb9c9f39120c9a87b26f031ccdb /src/linux
parentb64d66d0b04fde0af63c3a292be423736294dca9 (diff)
downloadmusl-38f2fa3d0207b8060302129c6464662751d4f2d3.tar.gz
musl-38f2fa3d0207b8060302129c6464662751d4f2d3.tar.bz2
musl-38f2fa3d0207b8060302129c6464662751d4f2d3.tar.xz
musl-38f2fa3d0207b8060302129c6464662751d4f2d3.zip
add memfd_create syscall wrapper
memfd_create was added in linux v3.17 and glibc has api for it.
Diffstat (limited to 'src/linux')
-rw-r--r--src/linux/memfd_create.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/linux/memfd_create.c b/src/linux/memfd_create.c
new file mode 100644
index 00000000..1649fe55
--- /dev/null
+++ b/src/linux/memfd_create.c
@@ -0,0 +1,8 @@
+#define _GNU_SOURCE 1
+#include <sys/mman.h>
+#include "syscall.h"
+
+int memfd_create(const char *name, unsigned flags)
+{
+ return syscall(SYS_memfd_create, name, flags);
+}