blob: 7bb5b097eb67153009dce1b20a31042ae283a392 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Ben Cheng655a7c02013-10-16 16:09:24 -07007#ifndef _UAPI_LINUX_PTRACE_H
8#define _UAPI_LINUX_PTRACE_H
9#include <linux/types.h>
10#define PTRACE_TRACEME 0
Ben Cheng655a7c02013-10-16 16:09:24 -070011#define PTRACE_PEEKTEXT 1
12#define PTRACE_PEEKDATA 2
13#define PTRACE_PEEKUSR 3
14#define PTRACE_POKETEXT 4
Ben Cheng655a7c02013-10-16 16:09:24 -070015#define PTRACE_POKEDATA 5
16#define PTRACE_POKEUSR 6
17#define PTRACE_CONT 7
18#define PTRACE_KILL 8
Ben Cheng655a7c02013-10-16 16:09:24 -070019#define PTRACE_SINGLESTEP 9
20#define PTRACE_ATTACH 16
21#define PTRACE_DETACH 17
22#define PTRACE_SYSCALL 24
Ben Cheng655a7c02013-10-16 16:09:24 -070023#define PTRACE_SETOPTIONS 0x4200
24#define PTRACE_GETEVENTMSG 0x4201
25#define PTRACE_GETSIGINFO 0x4202
26#define PTRACE_SETSIGINFO 0x4203
Ben Cheng655a7c02013-10-16 16:09:24 -070027#define PTRACE_GETREGSET 0x4204
28#define PTRACE_SETREGSET 0x4205
29#define PTRACE_SEIZE 0x4206
30#define PTRACE_INTERRUPT 0x4207
Ben Cheng655a7c02013-10-16 16:09:24 -070031#define PTRACE_LISTEN 0x4208
32#define PTRACE_PEEKSIGINFO 0x4209
33struct ptrace_peeksiginfo_args {
Tao Baod7db5942015-01-28 10:07:51 -080034 __u64 off;
Tao Baod7db5942015-01-28 10:07:51 -080035 __u32 flags;
36 __s32 nr;
Ben Cheng655a7c02013-10-16 16:09:24 -070037};
Christopher Ferris38062f92014-07-09 15:33:25 -070038#define PTRACE_GETSIGMASK 0x420a
Christopher Ferris38062f92014-07-09 15:33:25 -070039#define PTRACE_SETSIGMASK 0x420b
Christopher Ferris05d08e92016-02-04 13:16:38 -080040#define PTRACE_SECCOMP_GET_FILTER 0x420c
Christopher Ferris76a1d452018-06-27 14:12:29 -070041#define PTRACE_SECCOMP_GET_METADATA 0x420d
42struct seccomp_metadata {
43 __u64 filter_off;
44 __u64 flags;
45};
Christopher Ferrisb8a95e22019-10-02 18:29:20 -070046#define PTRACE_GET_SYSCALL_INFO 0x420e
47#define PTRACE_SYSCALL_INFO_NONE 0
48#define PTRACE_SYSCALL_INFO_ENTRY 1
49#define PTRACE_SYSCALL_INFO_EXIT 2
50#define PTRACE_SYSCALL_INFO_SECCOMP 3
51struct ptrace_syscall_info {
52 __u8 op;
Christopher Ferris05667cd2021-02-16 16:01:34 -080053 __u8 pad[3];
54 __u32 arch;
Christopher Ferrisb8a95e22019-10-02 18:29:20 -070055 __u64 instruction_pointer;
56 __u64 stack_pointer;
57 union {
58 struct {
59 __u64 nr;
60 __u64 args[6];
61 } entry;
62 struct {
63 __s64 rval;
64 __u8 is_error;
65 } exit;
66 struct {
67 __u64 nr;
68 __u64 args[6];
69 __u32 ret_data;
70 } seccomp;
71 };
72};
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +000073#define PTRACE_GET_RSEQ_CONFIGURATION 0x420f
74struct ptrace_rseq_configuration {
75 __u64 rseq_abi_pointer;
76 __u32 rseq_abi_size;
77 __u32 signature;
78 __u32 flags;
79 __u32 pad;
80};
Christopher Ferris37c3f3c2023-07-10 10:59:05 -070081#define PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG 0x4210
82#define PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG 0x4211
83struct ptrace_sud_config {
84 __u64 mode;
85 __u64 selector;
86 __u64 offset;
87 __u64 len;
88};
Christopher Ferrisb8a95e22019-10-02 18:29:20 -070089#define PTRACE_EVENTMSG_SYSCALL_ENTRY 1
90#define PTRACE_EVENTMSG_SYSCALL_EXIT 2
Christopher Ferris38062f92014-07-09 15:33:25 -070091#define PTRACE_PEEKSIGINFO_SHARED (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -070092#define PTRACE_EVENT_FORK 1
Christopher Ferris05d08e92016-02-04 13:16:38 -080093#define PTRACE_EVENT_VFORK 2
Ben Cheng655a7c02013-10-16 16:09:24 -070094#define PTRACE_EVENT_CLONE 3
95#define PTRACE_EVENT_EXEC 4
96#define PTRACE_EVENT_VFORK_DONE 5
Christopher Ferris05d08e92016-02-04 13:16:38 -080097#define PTRACE_EVENT_EXIT 6
Ben Cheng655a7c02013-10-16 16:09:24 -070098#define PTRACE_EVENT_SECCOMP 7
99#define PTRACE_EVENT_STOP 128
100#define PTRACE_O_TRACESYSGOOD 1
Christopher Ferris05d08e92016-02-04 13:16:38 -0800101#define PTRACE_O_TRACEFORK (1 << PTRACE_EVENT_FORK)
Ben Cheng655a7c02013-10-16 16:09:24 -0700102#define PTRACE_O_TRACEVFORK (1 << PTRACE_EVENT_VFORK)
103#define PTRACE_O_TRACECLONE (1 << PTRACE_EVENT_CLONE)
104#define PTRACE_O_TRACEEXEC (1 << PTRACE_EVENT_EXEC)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800105#define PTRACE_O_TRACEVFORKDONE (1 << PTRACE_EVENT_VFORK_DONE)
Ben Cheng655a7c02013-10-16 16:09:24 -0700106#define PTRACE_O_TRACEEXIT (1 << PTRACE_EVENT_EXIT)
107#define PTRACE_O_TRACESECCOMP (1 << PTRACE_EVENT_SECCOMP)
108#define PTRACE_O_EXITKILL (1 << 20)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800109#define PTRACE_O_SUSPEND_SECCOMP (1 << 21)
110#define PTRACE_O_MASK (0x000000ff | PTRACE_O_EXITKILL | PTRACE_O_SUSPEND_SECCOMP)
Ben Cheng655a7c02013-10-16 16:09:24 -0700111#include <asm/ptrace.h>
112#endif