Skip to content

Commit

Permalink
Auto merge of #2553 - devnexen:obsd_ptrace_state, r=Amanieu
Browse files Browse the repository at this point in the history
couple of ptrace query for openbsd
  • Loading branch information
bors committed Nov 19, 2021
2 parents 53dfd6f + cd79a4a commit 1a4a999
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libc-test/semver/openbsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,15 @@ PT_ATTACH
PT_CONTINUE
PT_DETACH
PT_FIRSTMACH
PT_GET_EVENT_MASK
PT_GET_PROCESS_STATE
PT_GET_THREAD_FIRST
PT_GET_THREAD_NEXT
PT_IO
PT_KILL
PT_READ_D
PT_READ_I
PT_SET_EVENT_MASK
PT_TRACE_ME
PT_WRITE_D
PT_WRITE_I
Expand Down Expand Up @@ -1060,6 +1065,8 @@ pthread_spinlock_t
pthread_stackseg_np
ptrace
ptrace_io_desc
ptrace_state
ptrace_thread_state
pwritev
qsort
rand
Expand Down
15 changes: 15 additions & 0 deletions src/unix/bsd/netbsdlike/openbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,16 @@ s! {
pub kve_inheritance: ::c_int,
pub kve_flags: u8,
}

pub struct ptrace_state {
pub pe_report_event: ::c_int,
pub pe_other_pid: ::pid_t,
pub pe_tid: ::pid_t,
}

pub struct ptrace_thread_state {
pub pts_tid: ::pid_t,
}
}

impl siginfo_t {
Expand Down Expand Up @@ -1428,6 +1438,11 @@ pub const PTHREAD_STACK_MIN: ::size_t = 1_usize << _MAX_PAGE_SHIFT;
pub const MINSIGSTKSZ: ::size_t = 3_usize << _MAX_PAGE_SHIFT;
pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + (1_usize << _MAX_PAGE_SHIFT) * 4;

pub const PT_SET_EVENT_MASK: ::c_int = 12;
pub const PT_GET_EVENT_MASK: ::c_int = 13;
pub const PT_GET_PROCESS_STATE: ::c_int = 14;
pub const PT_GET_THREAD_FIRST: ::c_int = 15;
pub const PT_GET_THREAD_NEXT: ::c_int = 16;
pub const PT_FIRSTMACH: ::c_int = 32;

pub const SOCK_CLOEXEC: ::c_int = 0x8000;
Expand Down

0 comments on commit 1a4a999

Please sign in to comment.