#define MREMAP_FIXED 2
#define MLOCK_ONFAULT 0x01
+
+#define MFD_CLOEXEC 0x0001U
+#define MFD_ALLOW_SEALING 0x0002U
+#define MFD_HUGETLB 0x0004U
#endif
#include <bits/mman.h>
#ifdef _GNU_SOURCE
void *mremap (void *, size_t, size_t, int, ...);
int remap_file_pages (void *, size_t, int, size_t, int);
+int memfd_create (const char *, unsigned);
int mlock2 (const void *, size_t, unsigned);
#endif
--- /dev/null
+#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);
+}