On Fri, Jan 12, 2001 at 12:48:36AM +0100, James R. Leu wrote:
> Hello David,
>
> On Thu, Jan 11, 2001 at 03:10:01PM -0800, David S. Miller wrote:
> >
> > James R. Leu writes:
> > > It seems that TCPs recvmsg/sendmsg and ioctl for SIOCINQ/SIOCOUTQ do not
> > > check to make sure the socket is connected.
> >
> > And what is the problem with that?
> >
> > If the socket is in the process of connecting (SYN_SENT or SYN_RECV)
> > then SIOCINQ/SIOCOUTQ will report zero. If closed or closing, it will
> > report zero since by definition all data is sent. The only invalid
> > case is LISTEN, and we flag this with -EINVAL.
>
> This makes sense. I interpreted the The man page for tcp(4) to say that
> FIONREAD and TIOCOUTQ would leave errno equal to EPIPE if the socket was
> closed.
.B FIONREAD, TIOCINQ
Returns the amount of queued unread data in the receive buffer. Argument
is a pointer to an integer.
I honestly don't see how it can be interpreted to state that.
-Andi
--
This is like TV. I don't like TV.
|