rust/library/std
Matthias Krüger d1070df553
Rollup merge of #127300 - biabbas:fix_connect_timeout, r=tgross35
Fix connect timeout for non-linux targets, read readiness of socket connection, Read readiness to detect errors. `Fixes #127018`

Fixes #127018
Connect_timeout would call `poll` and check `pollfd.revents` for POLLHUP error, rather that checking readiness. This behavior was meant for Linux as it returns POLLHUP | POLLOUT | POLLERR in case of errors. But on targets that do not return POLLHUP in `pollfd.revents`, this would indicate a false success and result in this issue. To resolve this we will check readiness of socket using  `getsockopt():`  and return success from connect_timeout when there are no errors.
Changes were tested on Linux and an rtos.
![Screenshot 2024-07-04 105820](https://github.com/rust-lang/rust/assets/88673422/5ef5a87f-f2af-4fb7-98da-7612d5e27e9a)
Thank you.
2024-07-25 16:48:19 +02:00
..
benches also test parts of std 2024-04-07 10:05:57 +02:00
src Rollup merge of #127300 - biabbas:fix_connect_timeout, r=tgross35 2024-07-25 16:48:19 +02:00
tests Initial implementation of anonymous_pipe 2024-07-23 23:13:56 +10:00
build.rs std: Set has_reliable_f16 to false for MIPS targets in build.rs 2024-07-03 13:52:06 +02:00
Cargo.toml Auto merge of #127153 - NobodyXu:pipe, r=ChrisDenton 2024-07-24 00:03:14 +00:00