summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2021-11-06 18:53:05 +0000
committerDavid Carlier <devnexen@gmail.com>2021-11-06 21:39:13 +0000
commitc199251fbd9328e912a5d92859e9f5ed80bcc422 (patch)
treef6810778834a9e20e6b23d4bf4b7364d1039a40d
parent2af710a6342f07f86c0ae2f4a8619de7343481fe (diff)
downloadrust-libc-c199251fbd9328e912a5d92859e9f5ed80bcc422.tar.gz
freebsd ptrace request update
-rw-r--r--libc-test/build.rs6
-rw-r--r--libc-test/semver/freebsd.txt3
-rw-r--r--src/unix/bsd/freebsdlike/freebsd/mod.rs7
3 files changed, 16 insertions, 0 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 651f25039c..2bf2387610 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2034,6 +2034,9 @@ fn test_freebsd(target: &str) {
true
}
+ // Added in FreeBSD 12.1
+ "PT_GET_SC_RET" | "PT_GET_SC_ARGS" if Some(11) == freebsd_ver => true,
+
// Added in in FreeBSD 13.0 (r367776 and r367287)
"SCM_CREDS2" | "LOCAL_CREDS_PERSISTENT" if Some(13) > freebsd_ver => true,
@@ -2065,6 +2068,9 @@ fn test_freebsd(target: &str) {
// `procstat` is a private struct
"procstat" => true,
+ // `ptrace_sc_ret` is not available in FreeBSD 11
+ "ptrace_sc_ret" if Some(11) == freebsd_ver => true,
+
_ => false,
}
});
diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt
index 9413be7155..04359e1d90 100644
--- a/libc-test/semver/freebsd.txt
+++ b/libc-test/semver/freebsd.txt
@@ -916,6 +916,8 @@ PT_GETLWPLIST
PT_GETNUMLWPS
PT_GETREGS
PT_GET_EVENT_MASK
+PT_GET_SC_ARGS
+PT_GET_SC_RET
PT_IO
PT_KILL
PT_LWPINFO
@@ -1691,6 +1693,7 @@ pthread_spinlock_t
ptrace
ptrace_io_desc
ptrace_lwpinfo
+ptrace_sc_ret
ptrace_vm_entry
pututxline
pwritev
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index 57ce5ab96b..0f23d2c383 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -153,6 +153,11 @@ s! {
pub pl_syscall_narg: ::c_uint,
}
+ pub struct ptrace_sc_ret {
+ pub sr_retval: [::register_t; 2],
+ pub sr_error: ::c_int,
+ }
+
pub struct cpuset_t {
#[cfg(target_pointer_width = "64")]
__bits: [::c_long; 4],
@@ -1139,6 +1144,8 @@ pub const PT_FOLLOW_FORK: ::c_int = 23;
pub const PT_LWP_EVENTS: ::c_int = 24;
pub const PT_GET_EVENT_MASK: ::c_int = 25;
pub const PT_SET_EVENT_MASK: ::c_int = 26;
+pub const PT_GET_SC_ARGS: ::c_int = 27;
+pub const PT_GET_SC_RET: ::c_int = 28;
pub const PT_GETREGS: ::c_int = 33;
pub const PT_SETREGS: ::c_int = 34;
pub const PT_GETFPREGS: ::c_int = 35;