Re: tcp_do_sendmsg()

Alan Cox (alan@lxorguk.ukuu.org.uk)
Mon, 23 Mar 1998 18:18:01 +0000 (GMT)


> Because the socket is not established yet the kernel returns EAGAIN
> [why not ENOTCONN here, btw?],
> I think this is what POSIX mandates, maybe Alan knows if this is the
> case.

Let me check. Ok the wording isnt clear but it strongly implies you return
-ENOTCONN if the socket is not pending a connect attempt (ie in "ground"
state).

The gospel according to posix sayeth of send*()

"If no space is available at the socket to hold the message to be
transmitted due to flow control then these functions normally block until
all data can be transmitted unless O_NONBLOCK has been set."

"The pselect, select, or poll functions may be used to determine when it is
possible to send more data without blocking".

So I'd say either we let you queue data to send in write() when connecting
or select shouldnt say ready to write in such cases.

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu