Skip to content

Commit

Permalink
Fix test failed due to the unsafe change of getregs
Browse files Browse the repository at this point in the history
  • Loading branch information
Evian-Zhang committed Jun 15, 2024
1 parent db97950 commit 79c3093
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/sys/test_ptrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,16 @@ fn test_ptrace_syscall() {
.unwrap();

#[cfg(target_arch = "x86_64")]
let get_syscall_id =
|| ptrace::getregs(child).unwrap().orig_rax as libc::c_long;
let get_syscall_id = || {
unsafe { ptrace::getregs(child) }.unwrap().orig_rax
as libc::c_long
};

#[cfg(target_arch = "x86")]
let get_syscall_id =
|| ptrace::getregs(child).unwrap().orig_eax as libc::c_long;
let get_syscall_id = || {
unsafe { ptrace::getregs(child) }.unwrap().orig_eax
as libc::c_long
};

#[cfg(target_arch = "aarch64")]
let get_syscall_id =
Expand Down

0 comments on commit 79c3093

Please sign in to comment.