[PATCH] handle broken PTRACE_EVENT_STOP values

Mike Frysinger vapier at gentoo.org
Fri Feb 27 04:31:37 UTC 2015


For a few linux releases (3.1 through 3.3), this define in the exported
headers were broken.  Undefine it that's the case.

* ptrace.h [PTRACE_EVENT_STOP]: Undefine if PTRACE_EVENT_STOP is 7.
---
 ptrace.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/ptrace.h b/ptrace.h
index 1a5414d..065cbda 100644
--- a/ptrace.h
+++ b/ptrace.h
@@ -50,6 +50,12 @@ extern long ptrace(int, int, char *, long);
 #ifndef PTRACE_EVENT_SECCOMP
 # define PTRACE_EVENT_SECCOMP	7
 #endif
+#ifdef PTRACE_EVENT_STOP
+/* Linux 3.1 - 3.3 releases had a broken value.  It was fixed in 3.4.  */
+# if PTRACE_EVENT_STOP == 7
+#  undef PTRACE_EVENT_STOP
+# endif
+#endif
 #ifndef PTRACE_EVENT_STOP
 # define PTRACE_EVENT_STOP	128
 #endif
-- 
2.3.0





More information about the Strace-devel mailing list