Received: with ECARTIS (v1.0.0; list netdev); Thu, 15 Jul 2004 05:51:49 -0700 (PDT) Received: from mail.gmx.net (pop.gmx.net [213.165.64.20]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id i6FCpghe003984 for ; Thu, 15 Jul 2004 05:51:43 -0700 Received: (qmail 3633 invoked by uid 0); 15 Jul 2004 12:51:35 -0000 Received: from 62.245.207.82 by www4.gmx.net with HTTP; Thu, 15 Jul 2004 14:51:35 +0200 (MEST) Date: Thu, 15 Jul 2004 14:51:35 +0200 (MEST) From: "Michael T Kerrisk" To: Alexey Toptygin Cc: netdev@oss.sgi.com MIME-Version: 1.0 References: Subject: Re: kernel-manpage inconsistency X-Priority: 3 (Normal) X-Authenticated: #18454895 Message-ID: <4407.1089895895@www4.gmx.net> X-Mailer: WWW-Mail 1.6 (Global Message Exchange) X-Flags: 0001 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-archive-position: 6953 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mtk-lists@gmx.net Precedence: bulk X-list: netdev Hello Alexey, > I don't know wether this is a kernel issue or a manpage issue, I just > know that they disagree. > > In recv(2) it says: > > MSG_TRUNC > Return the real length of the packet, even when it was longer > than the passed buffer. Only valid for packet sockets. > > But this is not honored. I don't know the details here, sorry. A quick glance at the source (raw_recvmsg() in net/ipv4/raw.c) shows that MSG_TRUNC is used there. > Also, in udp(7), it says: > > IOCTLS > These ioctls can be accessed using ioctl(2). The correct syntax is: > > int value; > error = ioctl(tcp_socket, ioctl_type, &value); > > SIOCINQ > Gets a pointer to an integer as argument. Returns the size of > the next pending datagram in the integer in bytes, or 0 when no > datagram is pending. > > SIOCOUTQ > Returns the number of data bytes in the local send queue. Only > supported with Linux 2.4 and above. > > These don't appear to be implemented. ( They're not in any headers and > they're not listed in ioctl_list(2). ) They're names in the kernel source. In userland, FIONREAD and TIOCOUTQ will do the trick for sockets. > Please tell me who I need to report this to to get it fixed. The latest Linux man pages can always be found at ftp://ftp.win.tue.nl/pub/linux-local/manpages/ and the maintainer is Andries Brouwer (Andries.Brouwer@cwi.nl) -- he'll take suitable new man pages, or patches in "diff -u" format. > Also, if there is a way to get the length of the next incoming datagram, > I would love to know about it. FIONREAD on a datagram socket will do this. > Currently I'm resorting to: > > while(1){ > recvmsg(..., MSG_PEEK); > if ( flags & MSG_TRUNC ){ > double buffer size; > } else { > break; > } > } Cheers, Michael -- Michael Kerrisk mtk-lists@gmx.net