summaryrefslogtreecommitdiffstats
path: root/tests/memory/memfd_create/t_get_seals.c
diff options
context:
space:
mode:
authorDavid Ward <david.ward@ll.mit.edu>2019-11-11 14:06:01 -0500
committerDavid Ward <david.ward@ll.mit.edu>2019-11-11 14:06:01 -0500
commitbee04eadf8306be0349b9f75559a1fea80591d7f (patch)
treecfe6131460910719fab342b0c9e20076d7217d4f /tests/memory/memfd_create/t_get_seals.c
parenta86513b40ec92203cf73c27feed0f4045db15634 (diff)
downloadkernel-bee04eadf8306be0349b9f75559a1fea80591d7f.tar.gz
kernel-bee04eadf8306be0349b9f75559a1fea80591d7f.tar.xz
kernel-bee04eadf8306be0349b9f75559a1fea80591d7f.zip
Fix existing CI test for memfd_create()
The test was failing (after hanging for several hours) because of a hard-coded assumption about which file descriptor would be returned by memfd_create(). The actual file descriptor gets printed by the test program though, so read this and use it instead. (Adjust the test program so that this is not printed until the file is ready.) Resolve compiler warnings about implicit function declarations, by using the #include statements listed in the kernel.org man-pages.
Diffstat (limited to 'tests/memory/memfd_create/t_get_seals.c')
-rw-r--r--tests/memory/memfd_create/t_get_seals.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/memory/memfd_create/t_get_seals.c b/tests/memory/memfd_create/t_get_seals.c
index 8babe34d2..1a2c900e0 100644
--- a/tests/memory/memfd_create/t_get_seals.c
+++ b/tests/memory/memfd_create/t_get_seals.c
@@ -16,8 +16,9 @@
*
*/
-#include <linux/fcntl.h>
+#define _GNU_SOURCE
#include <unistd.h>
+#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>