The question is: what's wrong. The docs or the implementation?
I'd say the docs:
old version:
> ERRORS
> EBADF The descriptor is invalid.
>
> ENOTSOCK
> The descriptor references a file, not a socket.
>
> EOPNOTSUPP
> The referenced socket is not of type SOCK_STREAM.
>
> EFAULT The addr parameter is not in a writable part of the
> user address space.
>
> EWOULDBLOCK
> The socket is marked non-blocking and no connec-
> tions are present to be accepted.
new suggested addition:
EINVAL Some parameter is invalid. (e.g. socket state not appropriate)
ENOSR Out of system resources.
ETIMEDOUT
The initial connection setup timed out.
I couldn't find the ETIMEDOUT in the source. My fault probably.
2.1.102/net/ipv4/tcp.c says:
/* FIXME: need to check here if newsk has already
* an soft_err or err set.
* We have two options here then: reply (this behaviour matches
* Solaris) or return the error to the application (old Linux)
*/
This is what happened (Old linux): the error got returned to the
application. Maybe this issue is moot on newer linux kernels.
The manual page should certainly be updated. If your source-code
inspection shows other possible return values, or if you don't agree
with my additions, please reply. I'll send a patch to Andries Brouwer
in a few days.
Roger.
-- If it's there and you can see it, it's REAL |___R.E.Wolff@BitWizard.nl | If it's there and you can't see it, it's TRANSPARENT | Tel: +31-15-2137555 | If it's not there and you can see it, it's VIRTUAL |__FAX:_+31-15-2138217 | If it's not there and you can't see it, it's GONE! -- Roy Wilks, 1983 |_____|- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu