* memfd_create.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* linux/dummy.h (sys_memfd_create): Remove.
* pathtrace.c (pathtrace_match): Add SEN_memfd_create.
* xlat/memfd_create_flags.in: New file.
* tests/memfd_create.c: New file.
* tests/memfd_create.expected: Likewise.
* tests/memfd_create.test: New test.
* tests/Makefile.am: (check_PROGRAMS): Add memfd_create.
(TESTS): Add memfd_create.test.
(EXTRA_DIST): Add memfd_create.expected.
* tests/.gitignore: Add memfd_create.
loop.c \
lseek.c \
mem.c \
+ memfd_create.c \
mknod.c \
mount.c \
mtd.c \
#define sys_kcmp printargs
#define sys_kexec_file_load printargs
#define sys_lookup_dcookie printargs
-#define sys_memfd_create printargs
#define sys_name_to_handle_at printargs
#define sys_open_by_handle_at printargs
#define sys_sched_getattr printargs
--- /dev/null
+#include "defs.h"
+
+#include "xlat/memfd_create_flags.h"
+
+SYS_FUNC(memfd_create)
+{
+ printstr(tcp, tcp->u_arg[0], -1);
+ tprints(", ");
+ printflags(memfd_create_flags, tcp->u_arg[1], "MFD_???");
+
+ return RVAL_DECODED | RVAL_FD;
+}
case SEN_eventfd:
case SEN_fanotify_init:
case SEN_inotify_init1:
+ case SEN_memfd_create:
case SEN_perf_event_open:
case SEN_pipe:
case SEN_printargs:
ipc_msg
ipc_sem
ipc_shm
+memfd_create
mmap
mmap64
mmsg
ipc_msg \
ipc_sem \
ipc_shm \
+ memfd_create \
mmap \
mmap64 \
mmsg \
stat32-v.test \
stat64-v.test \
statfs.test \
+ memfd_create.test \
mmap.test \
mmap64.test \
mmsg.test \
ioctl.expected \
ip_mreq.expected \
ipc.sh \
+ memfd_create.expected \
mmsg.expected \
net.expected \
net-fd.expected \
--- /dev/null
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <unistd.h>
+#include <sys/syscall.h>
+
+#ifdef __NR_memfd_create
+
+int
+main(void)
+{
+ syscall(__NR_memfd_create, "strace", 7);
+ return 0;
+}
+
+#else
+
+int
+main(void)
+{
+ return 77;
+}
+
+#endif
--- /dev/null
+memfd_create\("strace", MFD_CLOEXEC\|MFD_ALLOW_SEALING\|0x4\) += -1 .*
--- /dev/null
+#!/bin/sh
+
+# Check memfd_create syscall decoding.
+
+. "${srcdir=.}/init.sh"
+
+run_prog
+run_strace -e memfd_create $args
+match_grep
+
+exit 0
--- /dev/null
+MFD_CLOEXEC 1
+MFD_ALLOW_SEALING 2