Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/checkpoint-restore/criu.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'criu/kerndat.c')
-rw-r--r--criu/kerndat.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/criu/kerndat.c b/criu/kerndat.c
index 5e49fc116..93617012a 100644
--- a/criu/kerndat.c
+++ b/criu/kerndat.c
@@ -997,6 +997,22 @@ out:
return exit_code;
}
+static int kerndat_has_openat2(void)
+{
+ if (sys_openat2(AT_FDCWD, ".", NULL, 0) != -1) {
+ pr_err("openat2 should fail\n");
+ return -1;
+ }
+ if (errno == ENOSYS) {
+ pr_debug("No openat2 syscall support\n");
+ kdat.has_openat2 = false;
+ } else {
+ kdat.has_openat2 = true;
+ }
+
+ return 0;
+}
+
#define KERNDAT_CACHE_FILE KDAT_RUNDIR "/criu.kdat"
#define KERNDAT_CACHE_FILE_TMP KDAT_RUNDIR "/.criu.kdat"
@@ -1586,6 +1602,10 @@ int kerndat_init(void)
pr_err("kerndat_has_move_mount_set_group failed when initializing kerndat.\n");
ret = -1;
}
+ if (!ret && kerndat_has_openat2()) {
+ pr_err("kerndat_has_openat2 failed when initializing kerndat.\n");
+ ret = -1;
+ }
kerndat_lsm();
kerndat_mmap_min_addr();