From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Arnaldo Carvalho de Melo" Date: Fri, 09 Nov 2007 14:30:00 +0000 Subject: Re: How much is available for reading on the socket? Message-Id: <20071109143000.GB12019@ghostprotocols.net> List-Id: References: <5bc4c4570710211900o6ccbc9belf2cc904c1b3af0c6@mail.gmail.com> In-Reply-To: <5bc4c4570710211900o6ccbc9belf2cc904c1b3af0c6@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: dccp@vger.kernel.org Em Fri, Nov 09, 2007 at 01:51:27PM +0000, Gerrit Renker escreveu: > | > using "ioctl (socket, FIONREAD, &readsize)" I can get how much is > | > available to read from the socket using TCP. Is there a equivalent > | > option for DCCP? > | > | Looks like dccp_ioctl() happily returns -ENOIOCTLCMD (for now). If you > | have IO and memory to waste, you can always recv(..., MSG_PEEK) to work > | around this. > | > Arnaldo wrote a patch which realises SIOCINQ (it is in 2.6.24-rc1/2). And, on Linux: include/linux/sockios.h /* Linux-specific socket ioctls */ #define SIOCINQ FIONREAD - Arnaldo