]> granicus.if.org Git - strace/commitdiff
Make PTRACE_PEEKUSER/PTRACE_POKEUSER checks less glibc specific
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 12 Nov 2013 21:20:50 +0000 (21:20 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 12 Nov 2013 21:20:50 +0000 (21:20 +0000)
* configure.ac (AC_CHECK_DECLS): Add PTRACE_PEEKUSER and
PTRACE_POKEUSER.
* defs.h: Define PTRACE_PEEKUSER and PTRACE_POKEUSER only if
they are not provided by <sys/ptrace.h>.

Reported by John Spencer.

configure.ac
defs.h

index 0cee6c56d45e738163fd58c76cbd034c808abfd1..3ea195601ca1ba555d41b72ab8605e0782dd7114 100644 (file)
@@ -274,6 +274,8 @@ AC_CHECK_DECLS(m4_normalize([
        PTRACE_O_TRACEFORK,
        PTRACE_O_TRACESYSGOOD,
        PTRACE_O_TRACEVFORK,
+       PTRACE_PEEKUSER,
+       PTRACE_POKEUSER,
        PTRACE_SETOPTIONS
 ]),,, [#include <sys/ptrace.h>])
 
diff --git a/defs.h b/defs.h
index 865c83dcd0cad2b185efbe68deb806a65cb2935e..5b2b0ca726a8ae9c1639e972a8484e9261383afb 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -245,8 +245,10 @@ extern long ptrace(int, int, char *, long);
 # define PTRACE_EVENT_EXIT     6
 #endif
 
-#if !defined(__GLIBC__)
+#if !HAVE_DECL_PTRACE_PEEKUSER
 # define PTRACE_PEEKUSER PTRACE_PEEKUSR
+#endif
+#if !HAVE_DECL_PTRACE_POKEUSER
 # define PTRACE_POKEUSER PTRACE_POKEUSR
 #endif