Skip to content

Commit 16c69c0

Browse files
committed
Auto merge of #2517 - devnexen:fbsd_ptrace_requpdate, r=JohnTitor
freebsd ptrace request update
2 parents bcfd392 + c199251 commit 16c69c0

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

libc-test/build.rs

+6
Original file line numberDiff line numberDiff line change
@@ -2034,6 +2034,9 @@ fn test_freebsd(target: &str) {
20342034
true
20352035
}
20362036

2037+
// Added in FreeBSD 12.1
2038+
"PT_GET_SC_RET" | "PT_GET_SC_ARGS" if Some(11) == freebsd_ver => true,
2039+
20372040
// Added in in FreeBSD 13.0 (r367776 and r367287)
20382041
"SCM_CREDS2" | "LOCAL_CREDS_PERSISTENT" if Some(13) > freebsd_ver => true,
20392042

@@ -2065,6 +2068,9 @@ fn test_freebsd(target: &str) {
20652068
// `procstat` is a private struct
20662069
"procstat" => true,
20672070

2071+
// `ptrace_sc_ret` is not available in FreeBSD 11
2072+
"ptrace_sc_ret" if Some(11) == freebsd_ver => true,
2073+
20682074
_ => false,
20692075
}
20702076
});

libc-test/semver/freebsd.txt

+3
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,8 @@ PT_GETLWPLIST
916916
PT_GETNUMLWPS
917917
PT_GETREGS
918918
PT_GET_EVENT_MASK
919+
PT_GET_SC_ARGS
920+
PT_GET_SC_RET
919921
PT_IO
920922
PT_KILL
921923
PT_LWPINFO
@@ -1691,6 +1693,7 @@ pthread_spinlock_t
16911693
ptrace
16921694
ptrace_io_desc
16931695
ptrace_lwpinfo
1696+
ptrace_sc_ret
16941697
ptrace_vm_entry
16951698
pututxline
16961699
pwritev

src/unix/bsd/freebsdlike/freebsd/mod.rs

+7
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ s! {
153153
pub pl_syscall_narg: ::c_uint,
154154
}
155155

156+
pub struct ptrace_sc_ret {
157+
pub sr_retval: [::register_t; 2],
158+
pub sr_error: ::c_int,
159+
}
160+
156161
pub struct cpuset_t {
157162
#[cfg(target_pointer_width = "64")]
158163
__bits: [::c_long; 4],
@@ -1139,6 +1144,8 @@ pub const PT_FOLLOW_FORK: ::c_int = 23;
11391144
pub const PT_LWP_EVENTS: ::c_int = 24;
11401145
pub const PT_GET_EVENT_MASK: ::c_int = 25;
11411146
pub const PT_SET_EVENT_MASK: ::c_int = 26;
1147+
pub const PT_GET_SC_ARGS: ::c_int = 27;
1148+
pub const PT_GET_SC_RET: ::c_int = 28;
11421149
pub const PT_GETREGS: ::c_int = 33;
11431150
pub const PT_SETREGS: ::c_int = 34;
11441151
pub const PT_GETFPREGS: ::c_int = 35;

0 commit comments

Comments
 (0)