testsuite/systemtap.syscall/memfd_secret.c
raw| 1 | /* COVERAGE: memfd_secret */ |
| 2 | |
| 3 | /* |
| 4 | * Glibc doesn't support memfd_secret yet, so we have to use syscall(2) |
| 5 | */ |
| 6 | #define _GNU_SOURCE |
| 7 | #include <sys/syscall.h> |
| 8 | #include <unistd.h> |
| 9 | #include <fcntl.h> |
| 10 | |
| 11 | int main() |
| 12 | { |
| 13 | #ifdef __NR_memfd_secret |
| 14 | int fd; |
| 15 | fd = syscall(__NR_memfd_secret, O_CLOEXEC); |
| 16 | //staptest// memfd_secret (O_CLOEXEC) = NNNN |
| 17 | |
| 18 | close(fd); |
| 19 | #endif |
| 20 | |
| 21 | return 0; |
| 22 | } |
| 23 |