os-rust/library/std
Denis Smirnov dfadd177a9
Make TCP connect() handle EINTR correctly
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-10-13 18:12:56 +07:00
..
benches mv std libs to library/ 2020-07-27 19:51:13 -05:00
src Make TCP connect() handle EINTR correctly 2023-10-13 18:12:56 +07:00
tests Add data race test to std::env::{get, set} 2023-08-20 21:50:45 +02:00
build.rs Support AIX in Rust standard library 2023-10-09 14:02:57 +08:00
Cargo.toml Invoke backtrace-rs buildscript in std buildscript 2023-10-02 19:34:27 -06:00