Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 0 additions & 52 deletions crates/libafl_bolts/src/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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) {
Expand Down
Loading