[CRIU] [PATCH 03/23] parasite-syscall.c: introduced the macro ARCH_SI_TRAP

Alexander Kartashov alekskartashov at parallels.com
Mon Jan 14 02:19:57 EST 2013


The macro is introduced to abstract from behavior of breakpoints:
they generate different values of the field siginfo.si_code on different architectures.
---
 arch/x86/include/asm/parasite-syscall.h |    4 ++++
 parasite-syscall.c                      |    2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/parasite-syscall.h b/arch/x86/include/asm/parasite-syscall.h
index dd5622a..1c3ae5d 100644
--- a/arch/x86/include/asm/parasite-syscall.h
+++ b/arch/x86/include/asm/parasite-syscall.h
@@ -1,6 +1,10 @@
 #ifndef __CR_ASM_PARASITE_SYSCALL_H__
 #define __CR_ASM_PARASITE_SYSCALL_H__
 
+
+#define ARCH_SI_TRAP SI_KERNEL
+
+
 extern const char code_syscall[];
 extern const int code_syscall_size;
 
diff --git a/parasite-syscall.c b/parasite-syscall.c
index c18cfc1..c051a53 100644
--- a/parasite-syscall.c
+++ b/parasite-syscall.c
@@ -100,7 +100,7 @@ again:
 			goto err;
 	}
 
-	if (WSTOPSIG(status) != SIGTRAP || siginfo.si_code != SI_KERNEL) {
+	if (WSTOPSIG(status) != SIGTRAP || siginfo.si_code != ARCH_SI_TRAP) {
 retry_signal:
 		pr_debug("** delivering signal %d si_code=%d\n",
 			 siginfo.si_signo, siginfo.si_code);
-- 
1.7.10.4



More information about the CRIU mailing list