hermit-os / hermit-os/kernel

Implement `SO_ERROR` for sockets

Open
#1,373 0 comments 0 reactions 1 assignee Claimed by @stlankes View on GitHub
Dominant language
Rust
Stars
1.5k
Forks
132
Avg merge
1d 14h
Merged PRs (30d)
39

Description

This `SO_ERROR` is commonly used to check sockets for errors, for example on non-blocking `connect` calls.

```c
getsockopt(sockfd, SOL_SOCKET, SO_ERROR, ...);
```

This is exposed in Rust as [`TcpStream::take_error`](https://doc.rust-lang.org/stable/std/net/struct.TcpStream.html#method.take_error), [`TcpListener::take_error`](https://doc.rust-lang.org/stable/std/net/struct.TcpListener.html#method.take_error), and [`UdpSocket::take_error`](https://doc.rust-lang.org/stable/std/net/struct.UdpSocket.html#method.take_error) via the currently not implemented [`std::sys::pal::hermit::net::Socket::take_error`](https://github.com/rust-lang/rust/blob/1.80.1/library/std/src/sys/pal/hermit/net.rs#L309-L311).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.