Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

couple of ptrace query for openbsd #2553

Merged
merged 1 commit into from
Nov 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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