add missing ptrace requests and options to sys/ptrace.h
[musl] / include / sys / ptrace.h
1 #ifndef _SYS_PTRACE_H
2 #define _SYS_PTRACE_H
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6
7 #define PTRACE_TRACEME 0
8 #define PT_TRACE_ME PTRACE_TRACEME
9
10 #define PTRACE_PEEKTEXT 1
11 #define PTRACE_PEEKDATA 2
12 #define PTRACE_PEEKUSER 3
13 #define PTRACE_POKETEXT 4
14 #define PTRACE_POKEDATA 5
15 #define PTRACE_POKEUSER 6
16 #define PTRACE_CONT 7
17 #define PTRACE_KILL 8
18 #define PTRACE_SINGLESTEP 9
19 #define PTRACE_GETREGS 12
20 #define PTRACE_SETREGS 13
21 #define PTRACE_GETFPREGS 14
22 #define PTRACE_SETFPREGS 15
23 #define PTRACE_ATTACH 16
24 #define PTRACE_DETACH 17
25 #define PTRACE_GETFPXREGS 18
26 #define PTRACE_SETFPXREGS 19
27 #define PTRACE_SYSCALL 24
28 #define PTRACE_SETOPTIONS 0x4200
29 #define PTRACE_GETEVENTMSG 0x4201
30 #define PTRACE_GETSIGINFO 0x4202
31 #define PTRACE_SETSIGINFO 0x4203
32 #define PTRACE_GETREGSET 0x4204
33 #define PTRACE_SETREGSET 0x4205
34 #define PTRACE_SEIZE 0x4206
35 #define PTRACE_INTERRUPT 0x4207
36 #define PTRACE_LISTEN 0x4208
37
38 #define PT_READ_I PTRACE_PEEKTEXT
39 #define PT_READ_D PTRACE_PEEKDATA
40 #define PT_READ_U PTRACE_PEEKUSER
41 #define PT_WRITE_I PTRACE_POKETEXT
42 #define PT_WRITE_D PTRACE_POKEDATA
43 #define PT_WRITE_U PTRACE_POKEUSER
44 #define PT_CONTINUE PTRACE_CONT
45 #define PT_KILL PTRACE_KILL
46 #define PT_STEP PTRACE_SINGLESTEP
47 #define PT_GETREGS PTRACE_GETREGS
48 #define PT_SETREGS PTRACE_SETREGS
49 #define PT_GETFPREGS PTRACE_GETFPREGS
50 #define PT_SETFPREGS PTRACE_SETFPREGS
51 #define PT_ATTACH PTRACE_ATTACH
52 #define PT_DETACH PTRACE_DETACH
53 #define PT_GETFPXREGS PTRACE_GETFPXREGS
54 #define PT_SETFPXREGS PTRACE_SETFPXREGS
55 #define PT_SYSCALL PTRACE_SYSCALL
56 #define PT_SETOPTIONS PTRACE_SETOPTIONS
57 #define PT_GETEVENTMSG PTRACE_GETEVENTMSG
58 #define PT_GETSIGINFO PTRACE_GETSIGINFO
59 #define PT_SETSIGINFO PTRACE_SETSIGINFO
60
61 #define PTRACE_O_TRACESYSGOOD   0x00000001
62 #define PTRACE_O_TRACEFORK      0x00000002
63 #define PTRACE_O_TRACEVFORK     0x00000004
64 #define PTRACE_O_TRACECLONE     0x00000008
65 #define PTRACE_O_TRACEEXEC      0x00000010
66 #define PTRACE_O_TRACEVFORKDONE 0x00000020
67 #define PTRACE_O_TRACEEXIT      0x00000040
68 #define PTRACE_O_TRACESECCOMP   0x00000080
69 #define PTRACE_O_EXITKILL       0x00100000
70 #define PTRACE_O_MASK           0x001000ff
71
72 #define PTRACE_EVENT_FORK 1
73 #define PTRACE_EVENT_VFORK 2
74 #define PTRACE_EVENT_CLONE 3
75 #define PTRACE_EVENT_EXEC 4
76 #define PTRACE_EVENT_VFORK_DONE 5
77 #define PTRACE_EVENT_EXIT 6
78 #define PTRACE_EVENT_SECCOMP 7
79
80 long ptrace(int, ...);
81
82 #ifdef __cplusplus
83 }
84 #endif
85 #endif