diff --git a/src/sys/unix/mod.rs b/src/sys/unix/mod.rs index a11fc6b28..935ca8439 100644 --- a/src/sys/unix/mod.rs +++ b/src/sys/unix/mod.rs @@ -5,6 +5,13 @@ macro_rules! syscall { ($fn: ident ( $($arg: expr),* $(,)* ) ) => {{ let res = unsafe { libc::$fn($($arg, )*) }; + #[cfg(target_os = "hermit")] + if res < 0 { + Err(std::io::Error::last_os_error()) + } else { + Ok(res) + } + #[cfg(unix)] if res == -1 { Err(std::io::Error::last_os_error()) } else {