Skip to content

Commit

Permalink
freebsd 14 add ptrace_sc_remote.
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Jan 19, 2023
1 parent 8958df1 commit 3350f36
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions libc-test/semver/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,7 @@ PT_LWP_EVENTS
PT_READ_D
PT_READ_I
PT_RESUME
PT_SC_REMOTE
PT_SETDBREGS
PT_SETFPREGS
PT_SETREGS
Expand Down Expand Up @@ -1833,6 +1834,7 @@ pthread_spinlock_t
ptrace
ptrace_io_desc
ptrace_lwpinfo
ptrace_sc_remote
ptrace_sc_ret
ptrace_vm_entry
ptsname_r
Expand Down
8 changes: 8 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3350f36

Please sign in to comment.