]> granicus.if.org Git - strace/blob - tests/memfd_create.c
480fd17713408686e729cb67e1ba30db03500b2f
[strace] / tests / memfd_create.c
1 #include "tests.h"
2 #include <asm/unistd.h>
3 #include "scno.h"
4
5 #ifdef __NR_memfd_create
6
7 # include <stdio.h>
8 # include <unistd.h>
9
10 int
11 main(void)
12 {
13         static const char text[] = "strace";
14         int rc = syscall(__NR_memfd_create, text, 7);
15
16         printf("memfd_create(\"%s\", %s) = %d %s (%m)\n",
17                text, "MFD_CLOEXEC|MFD_ALLOW_SEALING|0x4", rc, errno2name());
18
19         puts("+++ exited with 0 +++");
20         return 0;
21 }
22
23 #else
24
25 SKIP_MAIN_UNDEFINED("__NR_memfd_create")
26
27 #endif