]> granicus.if.org Git - strace/blobdiff - ptrace.h
print_array: enhance printing of unfetchable object addresses
[strace] / ptrace.h
index aba61b79c39a0db4250366e3da030cecbfad6530..6250547d5d58a3b488f67489d8e09c0557c3aab0 100644 (file)
--- a/ptrace.h
+++ b/ptrace.h
@@ -8,6 +8,7 @@
  * Copyright (c) 2011-2016 Dmitry V. Levin <ldv@altlinux.org>
  * Copyright (c) 2013 Ali Polatel <alip@exherbo.org>
  * Copyright (c) 2015 Mike Frysinger <vapier@gentoo.org>
+ * Copyright (c) 2015-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 #ifndef STRACE_PTRACE_H
 #define STRACE_PTRACE_H
 
-#ifdef NEED_PTRACE_PROTOTYPE_WORKAROUND
-# define ptrace xptrace
-# include <sys/ptrace.h>
-# undef ptrace
-extern long ptrace(int, int, char *, long);
-#else
-# include <sys/ptrace.h>
-#endif
+#include <sys/ptrace.h>
 
 #ifdef HAVE_STRUCT_IA64_FPREG
 # define ia64_fpreg XXX_ia64_fpreg
@@ -67,6 +61,16 @@ extern long ptrace(int, int, char *, long);
 # undef ptrace_peeksiginfo_args
 #endif
 
+#if defined(SPARC) || defined(SPARC64)
+/*
+ * SPARC has a different PTRACE_DETACH value correctly defined in sys/ptrace.h,
+ * but linux/ptrace.h clobbers it with the standard one.  PTRACE_SUNDETACH is
+ * also defined to the correct value by sys/ptrace.h, so use that instead.
+ */
+# undef PTRACE_DETACH
+# define PTRACE_DETACH PTRACE_SUNDETACH
+#endif
+
 #ifndef PTRACE_EVENT_FORK
 # define PTRACE_EVENT_FORK     1
 #endif
@@ -168,6 +172,9 @@ extern long ptrace(int, int, char *, long);
 #ifndef PTRACE_SECCOMP_GET_FILTER
 # define PTRACE_SECCOMP_GET_FILTER     0x420c
 #endif
+#ifndef PTRACE_SECCOMP_GET_METADATA
+# define PTRACE_SECCOMP_GET_METADATA   0x420d
+#endif
 
 #if !HAVE_DECL_PTRACE_PEEKUSER
 # define PTRACE_PEEKUSER PTRACE_PEEKUSR
@@ -176,4 +183,4 @@ extern long ptrace(int, int, char *, long);
 # define PTRACE_POKEUSER PTRACE_POKEUSR
 #endif
 
-#endif /* #ifndef STRACE_PTRACE_H */
+#endif /* !STRACE_PTRACE_H */