diff --git a/crates/libafl_bolts/src/os.rs b/crates/libafl_bolts/src/os.rs index c16d11e1cf..087acb52d3 100644 --- a/crates/libafl_bolts/src/os.rs +++ b/crates/libafl_bolts/src/os.rs @@ -65,52 +65,6 @@ pub fn last_os_error() -> i32 { std::io::Error::last_os_error().raw_os_error().unwrap_or(0) } -/// Returns the last OS error (errno). -/// -/// Currently supported on `no_std`: -/// * Linux -/// * Android -/// * macOS -/// * FreeBSD -/// * Dragonfly -/// * OpenBSD -/// * NetBSD -#[must_use] -#[cfg(all( - not(feature = "std"), - any( - target_os = "linux", - target_os = "android", - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "openbsd", - target_os = "netbsd" - ) -))] -pub fn last_os_error() -> i32 { - unsafe { - #[cfg(target_os = "linux")] - { - *libc::__errno_location() - } - #[cfg(target_os = "android")] - { - *libc::__errno() - } - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "openbsd", - target_os = "netbsd" - ))] - { - *libc::__error() - } - } -} - /// Waits for a pid and returns the status #[must_use] #[cfg(unix)] @@ -127,12 +81,6 @@ pub fn waitpid_with_signals(pid: i32) -> i32 { continue; } } - #[cfg(not(feature = "std"))] - { - if last_os_error() == libc::EINTR { - continue; - } - } return 0; } if libc::WIFSIGNALED(status) {