If using async connect(), after select for writeable, if getpeername() indicates connection failure, you can use getsockopt(SOL_SOCKET, SO_ERROR, ...) to find the error. But the linux people I guess didn't know about this, and changed connect() so that a 2nd connect() call on a failed socket returns the error directly. Fake this demented non-standard behaviour which Linux users are now starting to code to. Talk about dilution of the API...
If using async connect(), after select for writeable, if getpeername()
indicates connection failure, you can use getsockopt(SOL_SOCKET,
SO_ERROR, ...) to find the error. But the linux people I guess didn't
know about this, and changed connect() so that a 2nd connect() call on
a failed socket returns the error directly. Fake this demented
non-standard behaviour which Linux users are now starting to code to.
Talk about dilution of the API...

orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars