2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 05:48:05 +00:00

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 <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Andrew Vagin 2016-06-30 02:31:14 +03:00 committed by Pavel Emelyanov
parent ff0de098c8
commit 5ee1ac1f28
4 changed files with 0 additions and 33 deletions

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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;
/*

View File

@ -74,19 +74,3 @@ int main(int argc, char *argv[], char *envp[])
}
endef
define FEATURE_TEST_MEMFD
#include <unistd.h>
#include <sys/syscall.h>
int main(void)
{
#ifdef __NR_memfd_create
return 0;
#else
# error No memfd support
#endif
}
endef