diff --git a/Cargo.toml b/Cargo.toml index d62a0ca..3aa2455 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,7 @@ features = [ ] [target.'cfg(target_os = "hermit")'.dependencies.hermit-abi] -version = "0.3.8" +version = "0.3.9" [dev-dependencies] easy-parallel = "3.1.0" diff --git a/src/poll.rs b/src/poll.rs index 3f3b248..6e1432d 100644 --- a/src/poll.rs +++ b/src/poll.rs @@ -475,7 +475,9 @@ mod syscall { let fd = unsafe { hermit_abi::eventfd(count, 0) }; if fd == -1 { - Err(io::Error::last_os_error()) + Err(io::Error::from_raw_os_error(unsafe { + hermit_abi::get_errno() + })) } else { Ok(unsafe { OwnedFd::from_raw_fd(fd) }) } @@ -611,7 +613,9 @@ mod syscall { #[inline] fn cvt(len: isize) -> io::Result { if len == -1 { - Err(io::Error::last_os_error()) + Err(io::Error::from_raw_os_error(unsafe { + hermit_abi::get_errno() + })) } else { Ok(len as usize) }