aboutsummaryrefslogtreecommitdiffstats
path: root/test/filters/memwrexe.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/filters/memwrexe.c')
-rw-r--r--test/filters/memwrexe.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/filters/memwrexe.c b/test/filters/memwrexe.c
index b43b232d1..12787f3a5 100644
--- a/test/filters/memwrexe.c
+++ b/test/filters/memwrexe.c
@@ -6,12 +6,14 @@
6#include <sys/stat.h> 6#include <sys/stat.h>
7#include <fcntl.h> 7#include <fcntl.h>
8#include <sys/mman.h> 8#include <sys/mman.h>
9#include <sys/syscall.h>
9 10
10static void usage(void) { 11static void usage(void) {
11 printf("memwrexe options\n"); 12 printf("memwrexe options\n");
12 printf("where options is:\n"); 13 printf("where options is:\n");
13 printf("\tmmap - mmap test\n"); 14 printf("\tmmap - mmap test\n");
14 printf("\tmprotect - mprotect test\n"); 15 printf("\tmprotect - mprotect test\n");
16 printf("\tmemfd_create - memfd_create test\n");
15} 17}
16 18
17int main(int argc, char **argv) { 19int main(int argc, char **argv) {
@@ -72,4 +74,18 @@ int main(int argc, char **argv) {
72 74
73 return 0; 75 return 0;
74 } 76 }
77
78 else if (strcmp(argv[1], "memfd_create") == 0) {
79 int fd = syscall(SYS_memfd_create, "memfd_create", 0);
80 if (fd == -1) {
81 fprintf(stderr, "TESTING ERROR: cannot run memfd_create test\n");
82 return 1;
83 }
84 printf("memfd_create successful\n");
85
86 // wait for expect to timeout
87 sleep(100);
88
89 return 0;
90 }
75} 91}