Skip to content

Commit f4ae76c

Browse files
committed
Disable SYSEMU functions for musl targets
1 parent 35deab3 commit f4ae76c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/sys/ptrace/linux.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ libc_enum!{
109109
#[cfg(all(target_os = "linux", not(any(target_arch = "mips",
110110
target_arch = "mips64"))))]
111111
PTRACE_PEEKSIGINFO,
112-
#[cfg(all(target_os = "linux", any(target_arch = "x86",
113-
target_arch = "x86_64")))]
112+
#[cfg(all(target_os = "linux", target_env = "gnu",
113+
any(target_arch = "x86", target_arch = "x86_64")))]
114114
PTRACE_SYSEMU,
115-
#[cfg(all(target_os = "linux", any(target_arch = "x86",
116-
target_arch = "x86_64")))]
115+
#[cfg(all(target_os = "linux", target_env = "gnu",
116+
any(target_arch = "x86", target_arch = "x86_64")))]
117117
PTRACE_SYSEMU_SINGLESTEP,
118118
}
119119
}
@@ -308,7 +308,7 @@ pub fn syscall<T: Into<Option<Signal>>>(pid: Pid, sig: T) -> Result<()> {
308308
/// In contrast to the `syscall` function, the syscall stopped at will not be executed.
309309
/// Thus the the tracee will only be stopped once per syscall,
310310
/// optionally delivering a signal specified by `sig`.
311-
#[cfg(all(target_os = "linux", any(target_arch = "x86", target_arch = "x86_64")))]
311+
#[cfg(all(target_os = "linux", target_env = "gnu", any(target_arch = "x86", target_arch = "x86_64")))]
312312
pub fn sysemu<T: Into<Option<Signal>>>(pid: Pid, sig: T) -> Result<()> {
313313
let data = match sig.into() {
314314
Some(s) => s as i32 as *mut c_void,
@@ -431,7 +431,7 @@ pub fn step<T: Into<Option<Signal>>>(pid: Pid, sig: T) -> Result<()> {
431431
/// Advances the execution by a single step or until the next syscall.
432432
/// In case the tracee is stopped at a syscall, the syscall will not be executed.
433433
/// Optionally, the signal specified by `sig` is delivered to the tracee upon continuation.
434-
#[cfg(all(target_os = "linux", any(target_arch = "x86", target_arch = "x86_64")))]
434+
#[cfg(all(target_os = "linux", target_env = "gnu", any(target_arch = "x86", target_arch = "x86_64")))]
435435
pub fn step_or_sysemu<T: Into<Option<Signal>>>(pid: Pid, sig: T) -> Result<()> {
436436
let data = match sig.into() {
437437
Some(s) => s as i32 as *mut c_void,

0 commit comments

Comments
 (0)