netdev
[Top] [All Lists]

Re: TCP: sendmsg/recvmsg/ioctl(SIOCINQ/SIOCOUTQ)

To: "James R. Leu" <jleu@xxxxxxxxxxxxxx>
Subject: Re: TCP: sendmsg/recvmsg/ioctl(SIOCINQ/SIOCOUTQ)
From: Andi Kleen <ak@xxxxxx>
Date: Fri, 12 Jan 2001 15:12:48 +0100
Cc: "David S. Miller" <davem@xxxxxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <20010111174726.A29707@doit.wisc.edu>; from jleu@mindspring.com on Fri, Jan 12, 2001 at 12:48:36AM +0100
References: <921FA59842C3D111BB2400A0C9498D0B9EB241@exchange03.rl.ac.uk> <20010111164231.C29379@doit.wisc.edu> <14942.15689.642046.345119@pizda.ninka.net> <20010111174726.A29707@doit.wisc.edu>
Sender: owner-netdev@xxxxxxxxxxx
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.

<Prev in Thread] Current Thread [Next in Thread>