about summary refs log tree commit diff
path: root/library/std/src/sys/hermit/net.rs
AgeCommit message (Collapse)AuthorLines
2024-01-11std: begin moving platform support modules into `pal`joboet-372/+0
2023-10-13Make TCP connect() handle EINTR correctlyDenis Smirnov-0/+6
According to the POSIX standard, if connect() is interrupted by a signal that is caught while blocked waiting to establish a connection, connect() shall fail and set errno to EINTR, but the connection request shall not be aborted, and the connection shall be established asynchronously. If asynchronous connection was successfully established after EINTR and before the next connection attempt, OS returns EISCONN that was handled as an error before. This behavior is fixed now and we handle it as success. The problem affects MacOS users: Linux doesn't return EISCONN in this case, Windows connect() can not be interrupted without an old-fashoin WSACancelBlockingCall function that is not used in the library. So current solution gives connect() as OS specific implementation.
2023-09-03Rollup merge of #115489 - saethlin:is-interrupted, r=thomccMatthias Krüger-1/+1
Use std::io::Error::is_interrupted everywhere In https://github.com/rust-lang/rust/pull/115228 I introduced this helper and started using it, this PR uses it to replace all applicable uses of `std::io::Error::kind`. The justification is the same; for whatever reason LLVM totally flops optimizing `Error::kind` so it's nice to use it less. FYI ``@mkroening`` I swear the hermit changes look good, but I was so sure about the previous PR.
2023-09-03Use std::io::Error::is_interrupted everywhereBen Kimock-1/+1
2023-08-28fix(sys/hermit): remove obsolete network initializationMartin Kröning-7/+1
This function does not exist as of hermit-sys 0.4.1 [1]. Once std does not call this function, we can remove it entirely. [1]: https://github.com/hermitcore/hermit-rs/commit/e38f246e046c3ad50bd2f5e33d8d810d33891cbd#diff-a9b7fa816defab285f0d4fe69d4df4a0cbbcf1c89913000df3273aded949f257R10 Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
2023-05-01Inline AsRawFd implementationsKonrad Borowski-0/+1
2023-05-01Inline AsInner implementationsKonrad Borowski-0/+1
2023-03-29Implement read_buf for RustHermitStefan Lankes-7/+24
In principle, this PR extends rust-lang/rust#108326 for RustyHermit. Signed-off-by: Stefan Lankes <slankes@eonerc.rwth-aachen.de>
2023-02-24move IO traits to std/src/os/hermitStefan Lankes-1/+2
By moving the IO traits, the RustyHermit support is harmonized to of other operating systems.
2023-02-24add support of RustyHermit's BSD socket layerStefan Lankes-388/+250
RustHermit publishs a new kernel interface and supports a common BSD socket layer. By supporting this interface, the implementation can be harmonized to other operating systems. To realize this socket layer, the handling of file descriptors is also harmonized to other operating systems.
2022-09-05Hermit: Remove unused socklen_t (dead_code)Martin Kröning-2/+0
2022-05-09Use Rust 2021 prelude in std itself.Mara Bos-1/+0
2022-02-04Hide Repr details from io::Error, and rework `io::Error::new_const`.Thom Chiovoloni-25/+24
2021-10-16remove compiler warningsStefan Lankes-1/+1
2021-08-30add `TcpStream::set_linger` and `TcpStream::linger`ibraheemdev-0/+8
2021-06-15Rename ErrorKind::Unknown to Uncategorized.Mara Bos-22/+26
2021-06-15Fix copy-paste error in sys/hermit error message.Mara Bos-1/+1
2021-06-15Redefine `ErrorKind::Other` and stop using it in std.Mara Bos-21/+22
2021-04-20Change uses of never typeChristiaan Dirkx-2/+2
2021-04-20Replace `Void` with never typeChristiaan Dirkx-2/+2
2021-04-18Use `NotSupported` in more placesChristiaan Dirkx-39/+39
2021-03-21Use io::Error::new_const everywhere to avoid allocations.Mara Bos-66/+74
2020-07-27mv std libs to library/mark-0/+473