rust/library/std/src/sys/windows
bors 3fbcfd2b6f Auto merge of #116132 - darthunix:connect_poll, r=cuviper
Make TCP connect handle EINTR correctly

According to the [POSIX](https://pubs.opengroup.org/onlinepubs/009695399/functions/connect.html) 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. When the connection has been established asynchronously, select() and poll() shall indicate that the file descriptor for the socket is ready for writing.

The previous implementation differs from the recomendation: in a case of the EINTR we tried to reconnect in a loop and sometimes get EISCONN error (this problem was originally detected on MacOS).

1. More details about the problem in an [article](http://www.madore.org/~david/computers/connect-intr.html).
2. The original [issue](https://git.picodata.io/picodata/picodata/tarantool-module/-/issues/157).
2023-10-19 11:22:28 +00:00
..
alloc Rework std::sys::windows::alloc 2021-03-26 12:38:26 +01:00
args Update Windows arg parsing tests 2021-08-08 22:11:29 +01:00
c Test that unix sockets exist on Windows 2023-10-13 06:02:38 +01:00
handle Tests for unsound Windows file methods 2022-07-06 17:40:21 +01:00
locks std: remove lock wrappers in sys_common 2022-11-06 15:32:59 +01:00
os Replace AlignedAs with a more specific Align8 type 2022-08-30 01:15:59 -07:00
path Restore old behaviour on broken UNC paths 2022-09-03 07:56:38 +01:00
process Expose process main_thread_handle on Windows 2022-05-10 02:41:19 -03:00
stdio Fix bug in utf16_to_utf8 for zero length strings 2023-05-31 17:25:53 -07:00
thread_local_key Minor improvements to Windows TLS dtors 2023-07-20 23:27:24 +01:00
alloc.rs Explicitly link kernel32.lib from alloc 2022-09-10 11:57:36 +01:00
args.rs fix(std): Rename os_str_bytes to encoded_bytes 2023-09-01 19:33:16 -05:00
c.rs Remove libc 2023-10-06 00:35:00 +01:00
cmath.rs Remove libc 2023-10-06 00:35:00 +01:00
compat.rs remove additional [allow(unused_unsafe)] 2023-07-24 17:56:38 -04:00
env.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
fs.rs Make try_exists return Ok(true) for Windows UDS 2023-10-13 06:02:18 +01:00
handle.rs Update windows ffi bindings 2023-08-28 20:12:00 +01:00
io.rs Remove libc 2023-10-06 00:35:00 +01:00
memchr.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
mod.rs Add a new helper to avoid calling io::Error::kind 2023-08-25 21:26:06 -04:00
net.rs Make TCP connect() handle EINTR correctly 2023-10-13 18:12:56 +07:00
os.rs Usage zero as language id for FormatMessageW() 2023-08-19 14:32:15 +08:00
os_str.rs fix(std): Rename os_str_bytes to encoded_bytes 2023-09-01 19:33:16 -05:00
path.rs fix(std): Rename os_str_bytes to encoded_bytes 2023-09-01 19:33:16 -05:00
pipe.rs add FromOwnedFd/FromOwnedHandle for ChildStdin/out/err 2023-05-30 15:39:17 +02:00
process.rs Remove libc 2023-10-06 00:35:00 +01:00
rand.rs Lazy load ntdll functions on UWP 2023-06-10 16:34:20 +08:00
stack_overflow.rs Use new bindings 2023-05-05 20:48:16 +01:00
stack_overflow_uwp.rs Move all cleanup to sys::cleanup 2021-04-22 10:44:44 +02:00
stdio.rs Fix bug in utf16_to_utf8 for zero length strings 2023-05-31 17:25:53 -07:00
thread.rs Remove libc 2023-10-06 00:35:00 +01:00
thread_local_dtor.rs Minor improvements to Windows TLS dtors 2023-07-20 23:27:24 +01:00
thread_local_key.rs std: explain unconventional choice of let-else binding over while-let loop 2023-10-09 15:09:18 +02:00
thread_parking.rs Replace libc::{type} with crate::ffi::{type} 2023-01-28 11:24:13 +05:30
time.rs Support setting file accessed/modified timestamps 2022-07-15 02:54:06 -07:00