[CRIU] [PATCH 4/4] criu: Use __NR_memfd_create for testing memfd presence

Cyrill Gorcunov gorcunov at openvz.org
Tue Mar 15 05:41:10 PDT 2016


We define own SYS_memfd_create in case if it's missing
in libc, but we need it for user-namespace restore.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 criu/kerndat.c            | 1 +
 criu/shmem.c              | 1 +
 scripts/feature-tests.mak | 4 ++--
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/criu/kerndat.c b/criu/kerndat.c
index 362e8a9ad1fc..08d624530a4c 100644
--- a/criu/kerndat.c
+++ b/criu/kerndat.c
@@ -21,6 +21,7 @@
 #include "lsm.h"
 #include "proc_parse.h"
 #include "config.h"
+#include "syscall-codes.h"
 
 struct kerndat_s kdat = {
 	/*
diff --git a/criu/shmem.c b/criu/shmem.c
index 39de0eca13c9..493477ecee28 100644
--- a/criu/shmem.c
+++ b/criu/shmem.c
@@ -13,6 +13,7 @@
 #include "rst-malloc.h"
 #include "vma.h"
 #include "config.h"
+#include "syscall-codes.h"
 
 #include "protobuf.h"
 #include "images/pagemap.pb-c.h"
diff --git a/scripts/feature-tests.mak b/scripts/feature-tests.mak
index 525c73e1cbfc..3587e07f388b 100644
--- a/scripts/feature-tests.mak
+++ b/scripts/feature-tests.mak
@@ -100,10 +100,10 @@ define FEATURE_TEST_MEMFD
 
 int main(void)
 {
-#ifdef SYS_memfd_create
+#ifdef __NR_memfd_create
 	return 0;
 #else
-#error No memfd support
+# error No memfd support
 #endif
 }
 
-- 
2.5.0



More information about the CRIU mailing list