diff options
author | наб <nabijaczleweli@nabijaczleweli.xyz> | 2021-02-08 11:20:54 +0100 |
---|---|---|
committer | наб <nabijaczleweli@nabijaczleweli.xyz> | 2021-02-15 18:59:48 +0100 |
commit | 59c18e2c2fd608d0dbe42f7abe507a992e1c1472 (patch) | |
tree | 24cb79f4ff3c2d6ab593177f905959a038cbe3a8 | |
parent | f13f57a03344fe8924fb71541353742e2db20695 (diff) | |
download | nix-59c18e2c2fd608d0dbe42f7abe507a992e1c1472.zip |
Fix test_ptrace_syscall() on x32
Based on
https://github.com/nix-rust/nix/issues/1384#issuecomment-774708486
-rw-r--r-- | test/sys/test_ptrace.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/sys/test_ptrace.rs b/test/sys/test_ptrace.rs index 38cf408b..b9793b39 100644 --- a/test/sys/test_ptrace.rs +++ b/test/sys/test_ptrace.rs @@ -100,7 +100,7 @@ fn test_ptrace_cont() { ptrace::cont(child, Some(Signal::SIGKILL)).unwrap(); match waitpid(child, None) { Ok(WaitStatus::Signaled(pid, Signal::SIGKILL, _)) if pid == child => { - // FIXME It's been observed on some systems (apple) the + // FIXME It's been observed on some systems (apple) the // tracee may not be killed but remain as a zombie process // affecting other wait based tests. Add an extra kill just // to make sure there are no zombies. @@ -150,11 +150,11 @@ fn test_ptrace_syscall() { // set this option to recognize syscall-stops ptrace::setoptions(child, ptrace::Options::PTRACE_O_TRACESYSGOOD).unwrap(); - #[cfg(target_pointer_width = "64")] - let get_syscall_id = || ptrace::getregs(child).unwrap().orig_rax as i64; + #[cfg(target_arch = "x86_64")] + let get_syscall_id = || ptrace::getregs(child).unwrap().orig_rax as libc::c_long; - #[cfg(target_pointer_width = "32")] - let get_syscall_id = || ptrace::getregs(child).unwrap().orig_eax as i32; + #[cfg(target_arch = "x86")] + let get_syscall_id = || ptrace::getregs(child).unwrap().orig_eax as libc::c_long; // kill entry ptrace::syscall(child, None).unwrap(); |