diff --git a/src/sys/ptrace/linux.rs b/src/sys/ptrace/linux.rs index 447357e7c8..9d287f80ad 100644 --- a/src/sys/ptrace/linux.rs +++ b/src/sys/ptrace/linux.rs @@ -109,11 +109,11 @@ libc_enum!{ #[cfg(all(target_os = "linux", not(any(target_arch = "mips", target_arch = "mips64"))))] PTRACE_PEEKSIGINFO, - #[cfg(all(target_os = "linux", any(target_arch = "x86", - target_arch = "x86_64")))] + #[cfg(all(target_os = "linux", target_env = "gnu", + any(target_arch = "x86", target_arch = "x86_64")))] PTRACE_SYSEMU, - #[cfg(all(target_os = "linux", any(target_arch = "x86", - target_arch = "x86_64")))] + #[cfg(all(target_os = "linux", target_env = "gnu", + any(target_arch = "x86", target_arch = "x86_64")))] PTRACE_SYSEMU_SINGLESTEP, } } @@ -308,7 +308,7 @@ pub fn syscall>>(pid: Pid, sig: T) -> Result<()> { /// In contrast to the `syscall` function, the syscall stopped at will not be executed. /// Thus the the tracee will only be stopped once per syscall, /// optionally delivering a signal specified by `sig`. -#[cfg(all(target_os = "linux", any(target_arch = "x86", target_arch = "x86_64")))] +#[cfg(all(target_os = "linux", target_env = "gnu", any(target_arch = "x86", target_arch = "x86_64")))] pub fn sysemu>>(pid: Pid, sig: T) -> Result<()> { let data = match sig.into() { Some(s) => s as i32 as *mut c_void, @@ -431,7 +431,7 @@ pub fn step>>(pid: Pid, sig: T) -> Result<()> { /// Advances the execution by a single step or until the next syscall. /// In case the tracee is stopped at a syscall, the syscall will not be executed. /// Optionally, the signal specified by `sig` is delivered to the tracee upon continuation. -#[cfg(all(target_os = "linux", any(target_arch = "x86", target_arch = "x86_64")))] +#[cfg(all(target_os = "linux", target_env = "gnu", any(target_arch = "x86", target_arch = "x86_64")))] pub fn step_or_sysemu>>(pid: Pid, sig: T) -> Result<()> { let data = match sig.into() { Some(s) => s as i32 as *mut c_void,