diff --git a/.cirrus.yml b/.cirrus.yml index f72dc82abf763..d2102f1fa189c 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -29,7 +29,7 @@ task: task: name: nightly x86_64-unknown-freebsd-14 freebsd_instance: - image: freebsd-14-0-current-amd64-v20220902 + image: freebsd-14-0-current-amd64-v20230114 setup_script: - pkg install -y curl - curl https://sh.rustup.rs -sSf --output rustup.sh diff --git a/libc-test/build.rs b/libc-test/build.rs index 5bad58171cf80..c60bd1c9178ef 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2182,6 +2182,7 @@ fn test_freebsd(target: &str) { // Added in FreeBSD 14. "PT_COREDUMP" | "PC_ALL" | "PC_COMPRESS" | "PT_GETREGSET" | "PT_SETREGSET" + | "PT_SC_REMOTE" if Some(14) > freebsd_ver => { true @@ -2269,6 +2270,8 @@ fn test_freebsd(target: &str) { // `ptrace_coredump` introduced in FreeBSD 14. "ptrace_coredump" if Some(14) > freebsd_ver => true, + // `ptrace_sc_remote` introduced in FreeBSD 14. + "ptrace_sc_remote" if Some(14) > freebsd_ver => true, // `sockcred2` is not available in FreeBSD 12. "sockcred2" if Some(13) > freebsd_ver => true, diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index c188346b9b740..511e9b62c614a 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -970,6 +970,7 @@ PT_LWP_EVENTS PT_READ_D PT_READ_I PT_RESUME +PT_SC_REMOTE PT_SETDBREGS PT_SETFPREGS PT_SETREGS @@ -1833,6 +1834,7 @@ pthread_spinlock_t ptrace ptrace_io_desc ptrace_lwpinfo +ptrace_sc_remote ptrace_sc_ret ptrace_vm_entry ptsname_r diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 2a4fbbf05f3a7..0245cdb643fc1 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -355,6 +355,13 @@ s! { pub pc_limit: ::off_t, } + pub struct ptrace_sc_remote { + pub pscr_ret: ptrace_sc_ret, + pub pscr_syscall: ::c_uint, + pub pscr_nargs: ::c_uint, + pub pscr_args: *mut ::register_t, + } + pub struct cpuset_t { #[cfg(target_pointer_width = "64")] __bits: [::c_long; 4], @@ -2356,6 +2363,7 @@ pub const PT_VM_TIMESTAMP: ::c_int = 40; pub const PT_VM_ENTRY: ::c_int = 41; pub const PT_GETREGSET: ::c_int = 42; pub const PT_SETREGSET: ::c_int = 43; +pub const PT_SC_REMOTE: ::c_int = 44; pub const PT_FIRSTMACH: ::c_int = 64; pub const PTRACE_EXEC: ::c_int = 0x0001;