diff --git a/src/sys/ptrace/linux.rs b/src/sys/ptrace/linux.rs index d2c22c97ab..54e453ba17 100644 --- a/src/sys/ptrace/linux.rs +++ b/src/sys/ptrace/linux.rs @@ -9,8 +9,10 @@ use sys::signal::Signal; pub type AddressType = *mut ::libc::c_void; -#[cfg(any(all(target_os = "linux", any(target_arch = "x86_64", - target_arch = "i686"))))] +#[cfg(all(target_os = "linux", + any(target_arch = "x86_64", + target_arch = "x86"), + target_env = "gnu"))] use libc::user_regs_struct; cfg_if! { @@ -197,15 +199,19 @@ fn ptrace_peek(request: Request, pid: Pid, addr: AddressType, data: *mut c_void) } /// Get user registers, as with `ptrace(PTRACE_GETREGS, ...)` -#[cfg(any(all(target_os = "linux", any(target_arch = "x86_64", - target_arch = "i686"))))] +#[cfg(all(target_os = "linux", + any(target_arch = "x86_64", + target_arch = "x86"), + target_env = "gnu"))] pub fn getregs(pid: Pid) -> Result { ptrace_get_data::(Request::PTRACE_GETREGS, pid) } /// Set user registers, as with `ptrace(PTRACE_SETREGS, ...)` -#[cfg(any(all(target_os = "linux", any(target_arch = "x86_64", - target_arch = "i686"))))] +#[cfg(all(target_os = "linux", + any(target_arch = "x86_64", + target_arch = "x86"), + target_env = "gnu"))] pub fn setregs(pid: Pid, regs: user_regs_struct) -> Result<()> { let res = unsafe { libc::ptrace(Request::PTRACE_SETREGS as RequestType,