Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion library/std/src/sys/net/connection/socket/hermit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ impl Socket {
}

pub fn take_error(&self) -> io::Result<Option<io::Error>> {
unimplemented!()
let raw: c_int = getsockopt(self, libc::SOL_SOCKET, libc::SO_ERROR)?;
if raw == 0 { Ok(None) } else { Ok(Some(io::Error::from_raw_os_error(raw as i32))) }
}

// This is used by sys_common code to abstract over Windows and Unix.
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/pal/hermit/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::ffi::{OsStr, OsString};
use crate::marker::PhantomData;
use crate::path::{self, PathBuf};
use crate::sys::unsupported;
use crate::{fmt, io, str};
use crate::{fmt, io};

pub fn errno() -> i32 {
unsafe { hermit_abi::get_errno() }
Expand Down
Loading