blob: 1a5414dba1d48b12979fc490d1174fadc01576d2 [file] [log] [blame]
Dmitry V. Levinfadf3792015-02-13 00:26:38 +00001#ifdef NEED_PTRACE_PROTOTYPE_WORKAROUND
2# define ptrace xptrace
3# include <sys/ptrace.h>
4# undef ptrace
5extern long ptrace(int, int, char *, long);
6#else
7# include <sys/ptrace.h>
8#endif
9
10#ifdef HAVE_STRUCT_IA64_FPREG
11# define ia64_fpreg XXX_ia64_fpreg
12#endif
13#ifdef HAVE_STRUCT_PT_ALL_USER_REGS
14# define pt_all_user_regs XXX_pt_all_user_regs
15#endif
16#ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS
17# define ptrace_peeksiginfo_args XXX_ptrace_peeksiginfo_args
18#endif
19
20#include <linux/ptrace.h>
21
22#ifdef HAVE_STRUCT_IA64_FPREG
23# undef ia64_fpreg
24#endif
25#ifdef HAVE_STRUCT_PT_ALL_USER_REGS
26# undef pt_all_user_regs
27#endif
28#ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS
29# undef ptrace_peeksiginfo_args
30#endif
31
32#ifndef PTRACE_EVENT_FORK
33# define PTRACE_EVENT_FORK 1
34#endif
35#ifndef PTRACE_EVENT_VFORK
36# define PTRACE_EVENT_VFORK 2
37#endif
38#ifndef PTRACE_EVENT_CLONE
39# define PTRACE_EVENT_CLONE 3
40#endif
41#ifndef PTRACE_EVENT_EXEC
42# define PTRACE_EVENT_EXEC 4
43#endif
44#ifndef PTRACE_EVENT_VFORK_DONE
45# define PTRACE_EVENT_VFORK_DONE 5
46#endif
47#ifndef PTRACE_EVENT_EXIT
48# define PTRACE_EVENT_EXIT 6
49#endif
50#ifndef PTRACE_EVENT_SECCOMP
51# define PTRACE_EVENT_SECCOMP 7
52#endif
53#ifndef PTRACE_EVENT_STOP
54# define PTRACE_EVENT_STOP 128
55#endif
56
57#ifndef PTRACE_O_TRACESYSGOOD
58# define PTRACE_O_TRACESYSGOOD 1
59#endif
60#ifndef PTRACE_O_TRACEFORK
61# define PTRACE_O_TRACEFORK (1 << PTRACE_EVENT_FORK)
62#endif
63#ifndef PTRACE_O_TRACEVFORK
64# define PTRACE_O_TRACEVFORK (1 << PTRACE_EVENT_VFORK)
65#endif
66#ifndef PTRACE_O_TRACECLONE
67# define PTRACE_O_TRACECLONE (1 << PTRACE_EVENT_CLONE)
68#endif
69#ifndef PTRACE_O_TRACEEXEC
70# define PTRACE_O_TRACEEXEC (1 << PTRACE_EVENT_EXEC)
71#endif
72#ifndef PTRACE_O_TRACEVFORKDONE
73# define PTRACE_O_TRACEVFORKDONE (1 << PTRACE_EVENT_VFORK_DONE)
74#endif
75#ifndef PTRACE_O_TRACEEXIT
76# define PTRACE_O_TRACEEXIT (1 << PTRACE_EVENT_EXIT)
77#endif
78#ifndef PTRACE_O_TRACESECCOMP
79# define PTRACE_O_TRACESECCOMP (1 << PTRACE_EVENT_SECCOMP)
80#endif
81#ifndef PTRACE_O_EXITKILL
82# define PTRACE_O_EXITKILL (1 << 20)
83#endif
84
85#ifndef PTRACE_SETOPTIONS
86# define PTRACE_SETOPTIONS 0x4200
87#endif
88#ifndef PTRACE_GETEVENTMSG
89# define PTRACE_GETEVENTMSG 0x4201
90#endif
91#ifndef PTRACE_GETSIGINFO
92# define PTRACE_GETSIGINFO 0x4202
93#endif
94#ifndef PTRACE_SETSIGINFO
95# define PTRACE_SETSIGINFO 0x4203
96#endif
97#ifndef PTRACE_GETREGSET
98# define PTRACE_GETREGSET 0x4204
99#endif
100#ifndef PTRACE_SETREGSET
101# define PTRACE_SETREGSET 0x4205
102#endif
103#ifndef PTRACE_SEIZE
104# define PTRACE_SEIZE 0x4206
105#endif
106#ifndef PTRACE_INTERRUPT
107# define PTRACE_INTERRUPT 0x4207
108#endif
109#ifndef PTRACE_LISTEN
110# define PTRACE_LISTEN 0x4208
111#endif
112#ifndef PTRACE_PEEKSIGINFO
113# define PTRACE_PEEKSIGINFO 0x4209
114#endif
115#ifndef PTRACE_GETSIGMASK
116# define PTRACE_GETSIGMASK 0x420a
117#endif
118#ifndef PTRACE_SETSIGMASK
119# define PTRACE_SETSIGMASK 0x420b
120#endif
121
122#if !HAVE_DECL_PTRACE_PEEKUSER
123# define PTRACE_PEEKUSER PTRACE_PEEKUSR
124#endif
125#if !HAVE_DECL_PTRACE_POKEUSER
126# define PTRACE_POKEUSER PTRACE_POKEUSR
127#endif