From 03aefdadb20f3bdd05bf644dc2ce1e85758a5aee Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Tue, 15 Mar 2011 17:19:09 +0000 Subject: Ensure that PTRACE_GETSIGINFO et al are always defined on Linux * configure.ac (AC_CHECK_DECLS): Add PTRACE_* constants. * defs.h [LINUX]: Define those PTRACE_* constants that are not provided by . --- configure.ac | 10 ++++++++++ defs.h | 19 +++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index c14c011..402f088 100644 --- a/configure.ac +++ b/configure.ac @@ -306,6 +306,16 @@ AC_CHECK_MEMBERS([struct sigcontext.sc_hi2],,, [#include AC_CHECK_DECLS([sys_errlist]) AC_CHECK_DECLS([sys_siglist, _sys_siglist],,, [#include ]) +AC_CHECK_DECLS([\ + PTRACE_SETOPTIONS, \ + PTRACE_GETEVENTMSG, \ + PTRACE_GETSIGINFO, \ + PTRACE_O_TRACEFORK, \ + PTRACE_O_TRACEVFORK, \ + PTRACE_O_TRACECLONE, \ + PTRACE_EVENT_FORK, \ + PTRACE_EVENT_VFORK, \ + PTRACE_EVENT_CLONE],,, [#include ]) AC_PATH_PROG([PERL], [perl]) diff --git a/defs.h b/defs.h index 7271280..8be668a 100644 --- a/defs.h +++ b/defs.h @@ -309,29 +309,32 @@ extern int mp_ioctl (int f, int c, void *a, int s); #endif #ifdef LINUX -# ifndef PTRACE_SETOPTIONS +# if !HAVE_DECL_PTRACE_SETOPTIONS # define PTRACE_SETOPTIONS 0x4200 # endif -# ifndef PTRACE_GETEVENTMSG +# if !HAVE_DECL_PTRACE_GETEVENTMSG # define PTRACE_GETEVENTMSG 0x4201 # endif -# ifndef PTRACE_O_TRACEFORK +# if !HAVE_DECL_PTRACE_GETSIGINFO +# define PTRACE_GETSIGINFO 0x4202 +# endif +# if !HAVE_DECL_PTRACE_O_TRACEFORK # define PTRACE_O_TRACEFORK 0x00000002 # endif -# ifndef PTRACE_O_TRACEVFORK +# if !HAVE_DECL_PTRACE_O_TRACEVFORK # define PTRACE_O_TRACEVFORK 0x00000004 # endif -# ifndef PTRACE_O_TRACECLONE +# if !HAVE_DECL_PTRACE_O_TRACECLONE # define PTRACE_O_TRACECLONE 0x00000008 # endif -# ifndef PTRACE_EVENT_FORK +# if !HAVE_DECL_PTRACE_EVENT_FORK # define PTRACE_EVENT_FORK 1 # endif -# ifndef PTRACE_EVENT_VFORK +# if !HAVE_DECL_PTRACE_EVENT_VFORK # define PTRACE_EVENT_VFORK 2 # endif -# ifndef PTRACE_EVENT_CLONE +# if !HAVE_DECL_PTRACE_EVENT_CLONE # define PTRACE_EVENT_CLONE 3 # endif #endif /* LINUX */ -- cgit v1.2.3