Check for additional PTRACE_* constants

* configure.ac (AC_CHECK_DECLS): Add PTRACE_O_TRACESYSGOOD,
PTRACE_O_TRACEEXEC, PTRACE_O_TRACEEXIT, PTRACE_EVENT_EXEC,
PTRACE_EVENT_VFORK_DONE and PTRACE_EVENT_EXIT.
* defs.h [LINUX]: Define these PTRACE_* constants when they are not
provided by <sys/ptrace.h>.

Reported-by: Douglas Mencken <dougmencken@gmail.com>
Reported-by: Steve Bennett <steveb@workware.net.au>
This commit is contained in:
Дмитрий Левин 2011-07-19 22:13:11 +00:00
parent d166c55f0d
commit 1b0df40644
2 changed files with 26 additions and 1 deletions

View File

@ -310,12 +310,18 @@ AC_CHECK_DECLS([
PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG,
PTRACE_GETSIGINFO,
PTRACE_O_TRACESYSGOOD,
PTRACE_O_TRACEFORK,
PTRACE_O_TRACEVFORK,
PTRACE_O_TRACECLONE,
PTRACE_O_TRACEEXEC,
PTRACE_O_TRACEEXIT,
PTRACE_EVENT_FORK,
PTRACE_EVENT_VFORK,
PTRACE_EVENT_CLONE],,, [#include <sys/ptrace.h>])
PTRACE_EVENT_CLONE,
PTRACE_EVENT_EXEC,
PTRACE_EVENT_VFORK_DONE,
PTRACE_EVENT_EXIT],,, [#include <sys/ptrace.h>])
AC_PATH_PROG([PERL], [perl])

19
defs.h
View File

@ -317,6 +317,10 @@ extern int mp_ioctl(int f, int c, void *a, int s);
# if !HAVE_DECL_PTRACE_GETSIGINFO
# define PTRACE_GETSIGINFO 0x4202
# endif
# if !HAVE_DECL_PTRACE_O_TRACESYSGOOD
# define PTRACE_O_TRACESYSGOOD 0x00000001
# endif
# if !HAVE_DECL_PTRACE_O_TRACEFORK
# define PTRACE_O_TRACEFORK 0x00000002
# endif
@ -326,6 +330,12 @@ extern int mp_ioctl(int f, int c, void *a, int s);
# if !HAVE_DECL_PTRACE_O_TRACECLONE
# define PTRACE_O_TRACECLONE 0x00000008
# endif
# if !HAVE_DECL_PTRACE_O_TRACEEXEC
# define PTRACE_O_TRACEEXEC 0x00000010
# endif
# if !HAVE_DECL_PTRACE_O_TRACEEXIT
# define PTRACE_O_TRACEEXIT 0x00000040
# endif
# if !HAVE_DECL_PTRACE_EVENT_FORK
# define PTRACE_EVENT_FORK 1
@ -336,6 +346,15 @@ extern int mp_ioctl(int f, int c, void *a, int s);
# if !HAVE_DECL_PTRACE_EVENT_CLONE
# define PTRACE_EVENT_CLONE 3
# endif
# if !HAVE_DECL_PTRACE_EVENT_EXEC
# define PTRACE_EVENT_EXEC 4
# endif
# if !HAVE_DECL_PTRACE_EVENT_VFORK_DONE
# define PTRACE_EVENT_VFORK_DONE 5
# endif
# if !HAVE_DECL_PTRACE_EVENT_EXIT
# define PTRACE_EVENT_EXIT 6
# endif
#endif /* LINUX */
#if !defined __GNUC__