From ad6e1bef9e8d1dac000fb457447a18e4fd57a9fd Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 30 Oct 2021 15:11:19 +0100 Subject: [PATCH] freebsd add ptrace_lwpinfo struct --- libc-test/semver/freebsd.txt | 14 +++++++++++++ src/unix/bsd/freebsdlike/freebsd/mod.rs | 28 +++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index ec803dda945c0..dacf3c9d7dbab 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -837,6 +837,19 @@ PIOD_READ_I PIOD_WRITE_D PIOD_WRITE_I PIPE_BUF +PL_EVENT_NONE +PL_EVENT_SIGNAL +PL_FLAG_BORN +PL_FLAG_BOUND +PL_FLAG_CHILD +PL_FLAG_EXEC +PL_FLAG_EXITED +PL_FLAG_VFORKED +PL_FLAG_VFORK_DONE +PL_FLAG_SA +PL_FLAG_SCE +PL_FLAG_SCX +PL_FLAG_SI PM_STR POLLINIGNEOF POLLRDBAND @@ -1675,6 +1688,7 @@ pthread_spin_unlock pthread_spinlock_t ptrace ptrace_io_desc +ptrace_lwpinfo ptrace_vm_entry pututxline pwritev diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 50c01b370ed6c..07e92e4c2f90c 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -140,6 +140,19 @@ s! { pub pve_path: *mut ::c_char, } + pub struct ptrace_lwpinfo { + pub pl_lwpid: lwpid_t, + pub pl_event: ::c_int, + pub pl_flags: ::c_int, + pub pl_sigmask: ::sigset_t, + pub pl_siglist: ::sigset_t, + pub pl_siginfo: ::siginfo_t, + pub pl_tdname: [::c_char; ::MAXCOMLEN as usize + 1], + pub pl_child_pid: ::pid_t, + pub pl_syscall_code: ::c_uint, + pub pl_syscall_narg: ::c_uint, + } + pub struct cpuset_t { #[cfg(target_pointer_width = "64")] __bits: [::c_long; 4], @@ -1096,6 +1109,21 @@ pub const LOCAL_CREDS_PERSISTENT: ::c_int = 3; pub const LOCAL_CONNWAIT: ::c_int = 4; pub const LOCAL_VENDOR: ::c_int = SO_VENDOR; +pub const PL_EVENT_NONE: ::c_int = 0; +pub const PL_EVENT_SIGNAL: ::c_int = 1; +pub const PL_FLAG_SA: ::c_int = 0x01; +pub const PL_FLAG_BOUND: ::c_int = 0x02; +pub const PL_FLAG_SCE: ::c_int = 0x04; +pub const PL_FLAG_SCX: ::c_int = 0x08; +pub const PL_FLAG_EXEC: ::c_int = 0x10; +pub const PL_FLAG_SI: ::c_int = 0x20; +pub const PL_FLAG_FORKED: ::c_int = 0x40; +pub const PL_FLAG_CHILD: ::c_int = 0x80; +pub const PL_FLAG_BORN: ::c_int = 0x100; +pub const PL_FLAG_EXITED: ::c_int = 0x200; +pub const PL_FLAG_VFORKED: ::c_int = 0x400; +pub const PL_FLAG_VFORK_DONE: ::c_int = 0x800; + pub const PT_LWPINFO: ::c_int = 13; pub const PT_GETNUMLWPS: ::c_int = 14; pub const PT_GETLWPLIST: ::c_int = 15;