From owner-svn-src-stable-8@FreeBSD.ORG Sat Jul 3 12:14:02 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B050106564A; Sat, 3 Jul 2010 12:14:02 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13A138FC1B; Sat, 3 Jul 2010 12:14:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o63CE1JB008628; Sat, 3 Jul 2010 12:14:01 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o63CE13Z008626; Sat, 3 Jul 2010 12:14:01 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201007031214.o63CE13Z008626@svn.freebsd.org> From: Christian Brueffer Date: Sat, 3 Jul 2010 12:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209661 - stable/8/lib/libc/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jul 2010 12:14:02 -0000 Author: brueffer Date: Sat Jul 3 12:14:01 2010 New Revision: 209661 URL: http://svn.freebsd.org/changeset/base/209661 Log: MFC: r207923 Document FIONREAD, FIONWRITE and FIONSPACE. Modified: stable/8/lib/libc/sys/ioctl.2 Directory Properties: stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/sys/ioctl.2 ============================================================================== --- stable/8/lib/libc/sys/ioctl.2 Sat Jul 3 12:09:45 2010 (r209660) +++ stable/8/lib/libc/sys/ioctl.2 Sat Jul 3 12:14:01 2010 (r209661) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 14, 2007 +.Dd May 11, 2010 .Dt IOCTL 2 .Os .Sh NAME @@ -80,6 +80,30 @@ Macros and defines used in specifying an .Fa request are located in the file .In sys/ioctl.h . +.Sh GENERIC IOCTLS +Some generic ioctls are not implemented for all types of file +descriptors. +These include: +.Bl -tag -width "xxxxxx" +.It Dv FIONREAD int +Get the number of bytes that are immediately available for reading. +.It Dv FIONWRITE int +Get the number of bytes in the descriptor's send queue. +These bytes are data which has been written to the descriptor but +which are being held by the kernel for further processing. +The nature of the required processing depends on the underlying device. +For TCP sockets, these bytes have not yet been acknowledged by the +other side of the connection. +.It Dv FIONSPACE int +Get the free space in the descriptor's send queue. +This value is the size of the send queue minus the number of bytes +being held in the queue. +Note: while this value represents the number of bytes that may be +added to the queue, other resource limitations may cause a write +not larger than the send queue's space to be blocked. +One such limitation would be a lack of network buffers for a write +to a network connection. +.El .Sh RETURN VALUES If an error has occurred, a value of -1 is returned and .Va errno