[CRIU] [PATCH 3/4] build: syscalls -- Add SYS_memfd_create

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


We need it for user namespace restore.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 criu/arch/ppc64/Makefile.syscalls     | 4 ++++
 criu/arch/scripts/arm/gen-syscalls.pl | 4 ++++
 criu/arch/x86/Makefile.syscalls       | 4 ++++
 3 files changed, 12 insertions(+)

diff --git a/criu/arch/ppc64/Makefile.syscalls b/criu/arch/ppc64/Makefile.syscalls
index f3431a7bc670..4c36d5a34834 100644
--- a/criu/arch/ppc64/Makefile.syscalls
+++ b/criu/arch/ppc64/Makefile.syscalls
@@ -21,6 +21,10 @@ $(obj)/$(SYS-CODES): $(obj)/syscalls/$(SYS-DEF)
 	$(Q) echo "#ifndef __ASM_CR_SYSCALL_CODES_H__"							>> $@
 	$(Q) echo "#define __ASM_CR_SYSCALL_CODES_H__"							>> $@
 	$(Q) cat $< | awk '/^__NR/{print "#ifndef",$$1,"\n# define",$$1,$$2,"\n#endif"}'		>> $@
+	$(Q) echo "/* Required SYS_ macros which might be missing in old libc versions */"		>> $@
+	$(Q) echo "#ifndef SYS_memfd_create"								>> $@
+	$(Q) echo "# define SYS_memfd_create __NR_memfd_create"						>> $@
+	$(Q) echo "#endif"										>> $@
 	$(Q) echo "#endif /* __ASM_CR_SYSCALL_CODES_H__ */"						>> $@
 cleanup-y		+= $(obj)/$(SYS-CODES)
 
diff --git a/criu/arch/scripts/arm/gen-syscalls.pl b/criu/arch/scripts/arm/gen-syscalls.pl
index 149f32d4e5b7..49064b047d6f 100755
--- a/criu/arch/scripts/arm/gen-syscalls.pl
+++ b/criu/arch/scripts/arm/gen-syscalls.pl
@@ -79,6 +79,10 @@ for (<IN>) {
 		print CODESOUT "#ifndef $code_macro\n";
 		print CODESOUT "# define $code_macro $+{$code}\n";
 		print CODESOUT "#endif\n";
+		print CODESOUT "/* Required SYS_ macros which might be missing in old libc versions */\n";
+		print CODESOUT "#ifndef SYS_memfd_create\n";
+		print CODESOUT "# define SYS_memfd_create __NR_memfd_create\n";
+		print CODESOUT "#endif\n";
 		print ASMOUT "syscall $sys_name, $code_macro\n";
 
 	} else {
diff --git a/criu/arch/x86/Makefile.syscalls b/criu/arch/x86/Makefile.syscalls
index c07d5585c943..6f6688551f7a 100644
--- a/criu/arch/x86/Makefile.syscalls
+++ b/criu/arch/x86/Makefile.syscalls
@@ -32,6 +32,10 @@ $(obj)/$(SYS-CODES): $(obj)/syscalls/$(SYS-DEF)
 	$(Q) echo "#ifndef __ASM_CR_SYSCALL_CODES_H__"							>> $@
 	$(Q) echo "#define __ASM_CR_SYSCALL_CODES_H__"							>> $@
 	$(Q) cat $< | awk '/^__NR/{print "#ifndef",$$1,"\n# define",$$1,$$2,"\n#endif"}'		>> $@
+	$(Q) echo "/* Required SYS_ macros which might be missing in old libc versions */"		>> $@
+	$(Q) echo "#ifndef SYS_memfd_create"								>> $@
+	$(Q) echo "# define SYS_memfd_create __NR_memfd_create"						>> $@
+	$(Q) echo "#endif"										>> $@
 	$(Q) echo "#endif /* __ASM_CR_SYSCALL_CODES_H__ */"						>> $@
 cleanup-y		+= $(obj)/$(SYS-CODES)
 
-- 
2.5.0



More information about the CRIU mailing list