Subject: connect() behavior with non-blocking I/O
To: None <tech-net@NetBSD.org>
From: Takahiro Kambe <taca@back-street.net>
List: tech-net
Date: 08/19/2003 20:48:07
Hi.

I've filled PR kern/22522 "connect(2) may fail with EINVAL which isn't
undocumented.".

As far as reading current connect(2), it is OK repeating connect()
with non-blocking socket and expecting errno would change:

1. EINPROGRESS
2. EALREADY, EISCONN, ECONNREFUSED or something other error

But currently second connect() returns EINVAL (not documented on
connect(2)).

(Of cource, there is another way to use select(2) or poll(2).)

What is the correct behavior of connect() with non-blocking I/O?

-- 
Takahiro Kambe <taca@back-street.net>