Skip to content

Commit

Permalink
Fix test for x86
Browse files Browse the repository at this point in the history
  • Loading branch information
frangio committed Jul 1, 2019
1 parent badb27a commit 4c990a4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/sys/test_ptrace.rs
Expand Up @@ -138,8 +138,12 @@ fn test_ptrace_syscall() {
// set this option to recognize syscall-stops
ptrace::setoptions(child, ptrace::Options::PTRACE_O_TRACESYSGOOD).unwrap();

#[cfg(target_arch = "x86_64")]
let get_syscall_id = || ptrace::getregs(child).unwrap().orig_rax as i64;

#[cfg(target_arch = "x86")]
let get_syscall_id = || ptrace::getregs(child).unwrap().orig_eax as i32;

// kill entry
ptrace::syscall(child, None).unwrap();
assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceSyscall(child)));
Expand Down

0 comments on commit 4c990a4

Please sign in to comment.