Skip to content

Commit 3c2bd77

Browse files
committed
Auto merge of rust-lang#712 - marmistrz:ptrace, r=alexcrichton
Add ptrace constants.
2 parents c40b6af + 21eb1c5 commit 3c2bd77

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed

Diff for: src/unix/notbsd/linux/musl/mod.rs

-10
Original file line numberDiff line numberDiff line change
@@ -185,16 +185,6 @@ pub const PTRACE_INTERRUPT: ::c_int = 0x4207;
185185
pub const PTRACE_LISTEN: ::c_int = 0x4208;
186186
pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
187187

188-
pub const PTRACE_O_EXITKILL: ::c_int = 1048576;
189-
pub const PTRACE_O_TRACECLONE: ::c_int = 8;
190-
pub const PTRACE_O_TRACEEXEC: ::c_int = 16;
191-
pub const PTRACE_O_TRACEEXIT: ::c_int = 64;
192-
pub const PTRACE_O_TRACEFORK: ::c_int = 2;
193-
pub const PTRACE_O_TRACESYSGOOD: ::c_int = 1;
194-
pub const PTRACE_O_TRACEVFORK: ::c_int = 4;
195-
pub const PTRACE_O_TRACEVFORKDONE: ::c_int = 32;
196-
pub const PTRACE_O_SUSPEND_SECCOMP: ::c_int = 2097152;
197-
198188
pub const MADV_DODUMP: ::c_int = 17;
199189
pub const MADV_DONTDUMP: ::c_int = 16;
200190

Diff for: src/unix/notbsd/linux/other/b64/x86_64.rs

-10
Original file line numberDiff line numberDiff line change
@@ -445,16 +445,6 @@ pub const PTRACE_GETFPXREGS: ::c_uint = 18;
445445
pub const PTRACE_SETFPXREGS: ::c_uint = 19;
446446
pub const PTRACE_GETREGS: ::c_uint = 12;
447447
pub const PTRACE_SETREGS: ::c_uint = 13;
448-
pub const PTRACE_O_EXITKILL: ::c_uint = 1048576;
449-
pub const PTRACE_O_TRACECLONE: ::c_uint = 8;
450-
pub const PTRACE_O_TRACEEXEC: ::c_uint = 16;
451-
pub const PTRACE_O_TRACEEXIT: ::c_uint = 64;
452-
pub const PTRACE_O_TRACEFORK: ::c_uint = 2;
453-
pub const PTRACE_O_TRACESYSGOOD: ::c_uint = 1;
454-
pub const PTRACE_O_TRACEVFORK: ::c_uint = 4;
455-
pub const PTRACE_O_TRACEVFORKDONE: ::c_uint = 32;
456-
pub const PTRACE_O_TRACESECCOMP: ::c_uint = 128;
457-
pub const PTRACE_O_SUSPEND_SECCOMP: ::c_uint = 2097152;
458448
pub const PTRACE_PEEKSIGINFO_SHARED: ::c_uint = 1;
459449

460450
pub const MCL_CURRENT: ::c_int = 0x0001;

Diff for: src/unix/notbsd/mod.rs

+24
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,30 @@ pub const WEXITED: ::c_int = 0x00000004;
719719
pub const WCONTINUED: ::c_int = 0x00000008;
720720
pub const WNOWAIT: ::c_int = 0x01000000;
721721

722+
// Options set using PTRACE_SETOPTIONS.
723+
pub const PTRACE_O_TRACESYSGOOD: ::c_int = 0x00000001;
724+
pub const PTRACE_O_TRACEFORK: ::c_int = 0x00000002;
725+
pub const PTRACE_O_TRACEVFORK: ::c_int = 0x00000004;
726+
pub const PTRACE_O_TRACECLONE: ::c_int = 0x00000008;
727+
pub const PTRACE_O_TRACEEXEC: ::c_int = 0x00000010;
728+
pub const PTRACE_O_TRACEVFORKDONE: ::c_int = 0x00000020;
729+
pub const PTRACE_O_TRACEEXIT: ::c_int = 0x00000040;
730+
pub const PTRACE_O_TRACESECCOMP: ::c_int = 0x00000080;
731+
pub const PTRACE_O_EXITKILL: ::c_int = 0x00100000;
732+
pub const PTRACE_O_SUSPEND_SECCOMP: ::c_int = 0x00200000;
733+
pub const PTRACE_O_MASK: ::c_int = 0x003000ff;
734+
735+
// Wait extended result codes for the above trace options.
736+
pub const PTRACE_EVENT_FORK: ::c_int = 1;
737+
pub const PTRACE_EVENT_VFORK: ::c_int = 2;
738+
pub const PTRACE_EVENT_CLONE: ::c_int = 3;
739+
pub const PTRACE_EVENT_EXEC: ::c_int = 4;
740+
pub const PTRACE_EVENT_VFORK_DONE: ::c_int = 5;
741+
pub const PTRACE_EVENT_EXIT: ::c_int = 6;
742+
pub const PTRACE_EVENT_SECCOMP: ::c_int = 7;
743+
// PTRACE_EVENT_STOP was added to glibc in 2.26
744+
// pub const PTRACE_EVENT_STOP: ::c_int = 128;
745+
722746
pub const __WNOTHREAD: ::c_int = 0x20000000;
723747
pub const __WALL: ::c_int = 0x40000000;
724748
pub const __WCLONE: ::c_int = 0x80000000;

0 commit comments

Comments
 (0)