Dmitry V. Levin
000fdc4b89
* tests/add_key.c: Include "scno.h" after <asm/unistd.h>. * tests/copy_file_range.c: Likewise. * tests/execveat.c: Likewise. * tests/kexec_file_load.c: Likewise. * tests/membarrier.c: Likewise. * tests/memfd_create.c: Likewise. * tests/mlock2.c: Likewise. * tests/pkey_alloc.c: Likewise. * tests/pkey_free.c: Likewise. * tests/pkey_mprotect.c: Likewise. * tests/preadv2-pwritev2.c: Likewise. * tests/userfaultfd.c: Likewise.
28 lines
457 B
C
28 lines
457 B
C
#include "tests.h"
|
|
#include <asm/unistd.h>
|
|
#include "scno.h"
|
|
|
|
#ifdef __NR_memfd_create
|
|
|
|
# include <stdio.h>
|
|
# include <unistd.h>
|
|
|
|
int
|
|
main(void)
|
|
{
|
|
static const char text[] = "strace";
|
|
int rc = syscall(__NR_memfd_create, text, 7);
|
|
|
|
printf("memfd_create(\"%s\", %s) = %d %s (%m)\n",
|
|
text, "MFD_CLOEXEC|MFD_ALLOW_SEALING|0x4", rc, errno2name());
|
|
|
|
puts("+++ exited with 0 +++");
|
|
return 0;
|
|
}
|
|
|
|
#else
|
|
|
|
SKIP_MAIN_UNDEFINED("__NR_memfd_create")
|
|
|
|
#endif
|