From 5ee1ac1f28e676efe407f19e9b020b24510f0db1 Mon Sep 17 00:00:00 2001 From: Andrew Vagin Date: Thu, 30 Jun 2016 02:31:14 +0300 Subject: [PATCH] criu: remove FEATURE_TEST_MEMFD It isn't required, __NR_memfd_create is defined in syscall-codes.h. With this patch, we can run all tests in travis-ci, because there a kernel has support of memfd, but __NR_memfd_create isn't defined in installed headers Signed-off-by: Andrew Vagin Signed-off-by: Pavel Emelyanov --- criu/kerndat.c | 8 -------- criu/parasite-syscall.c | 7 ------- criu/shmem.c | 2 -- scripts/feature-tests.mak | 16 ---------------- 4 files changed, 33 deletions(-) diff --git a/criu/kerndat.c b/criu/kerndat.c index 5793de180..3a7462e88 100644 --- a/criu/kerndat.c +++ b/criu/kerndat.c @@ -329,7 +329,6 @@ static int get_last_cap(void) return sysctl_op(req, ARRAY_SIZE(req), CTL_READ, 0); } -#ifdef CONFIG_HAS_MEMFD static bool kerndat_has_memfd_create(void) { int ret; @@ -347,13 +346,6 @@ static bool kerndat_has_memfd_create(void) return 0; } -#else -static bool kerndat_has_memfd_create(void) -{ - kdat.has_memfd = false; - return 0; -} -#endif static int get_task_size(void) { diff --git a/criu/parasite-syscall.c b/criu/parasite-syscall.c index 83a760e7f..c62853749 100644 --- a/criu/parasite-syscall.c +++ b/criu/parasite-syscall.c @@ -1202,7 +1202,6 @@ static int parasite_mmap_exchange(struct parasite_ctl *ctl, unsigned long size) return 0; } -#ifdef CONFIG_HAS_MEMFD static int parasite_memfd_exchange(struct parasite_ctl *ctl, unsigned long size) { void *where = (void *)ctl->syscall_ip + BUILTIN_SYSCALL_SIZE; @@ -1279,12 +1278,6 @@ err_cure: syscall_seized(ctl, __NR_close, &sret, fd, 0, 0, 0, 0, 0); return -1; } -#else -static int parasite_memfd_exchange(struct parasite_ctl *ctl, unsigned long size) -{ - return 1; -} -#endif int parasite_map_exchange(struct parasite_ctl *ctl, unsigned long size) { diff --git a/criu/shmem.c b/criu/shmem.c index d696c3b97..2d17076c1 100644 --- a/criu/shmem.c +++ b/criu/shmem.c @@ -422,7 +422,6 @@ static int open_shmem(int pid, struct vma_area *vma) } flags = MAP_SHARED; -#ifdef CONFIG_HAS_MEMFD if (kdat.has_memfd) { f = syscall(SYS_memfd_create, "", 0); if (f < 0) { @@ -436,7 +435,6 @@ static int open_shmem(int pid, struct vma_area *vma) } flags |= MAP_FILE; } else -#endif flags |= MAP_ANONYMOUS; /* diff --git a/scripts/feature-tests.mak b/scripts/feature-tests.mak index c3dc85e25..e009370ad 100644 --- a/scripts/feature-tests.mak +++ b/scripts/feature-tests.mak @@ -74,19 +74,3 @@ int main(int argc, char *argv[], char *envp[]) } endef - -define FEATURE_TEST_MEMFD - -#include -#include - -int main(void) -{ -#ifdef __NR_memfd_create - return 0; -#else -# error No memfd support -#endif -} - -endef