From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 21:24:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F35AF846; Wed, 24 Apr 2013 21:24:35 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E56181F0D; Wed, 24 Apr 2013 21:24:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3OLOZub034819; Wed, 24 Apr 2013 21:24:35 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3OLOZW5034818; Wed, 24 Apr 2013 21:24:35 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201304242124.r3OLOZW5034818@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 24 Apr 2013 21:24:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249859 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 21:24:36 -0000 Author: jilles Date: Wed Apr 24 21:24:35 2013 New Revision: 249859 URL: http://svnweb.freebsd.org/changeset/base/249859 Log: getdtablesize(2): Describe what this function actually does. getdtablesize() returns the limit on new file descriptors; this says nothing about existing descriptors. MFC after: 1 week Modified: head/lib/libc/sys/getdtablesize.2 Modified: head/lib/libc/sys/getdtablesize.2 ============================================================================== --- head/lib/libc/sys/getdtablesize.2 Wed Apr 24 21:21:03 2013 (r249858) +++ head/lib/libc/sys/getdtablesize.2 Wed Apr 24 21:24:35 2013 (r249859) @@ -28,12 +28,12 @@ .\" @(#)getdtablesize.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd April 24, 2013 .Dt GETDTABLESIZE 2 .Os .Sh NAME .Nm getdtablesize -.Nd get descriptor table size +.Nd get file descriptor limit .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -41,18 +41,20 @@ .Ft int .Fn getdtablesize void .Sh DESCRIPTION -Each process has a fixed size descriptor table, -which is guaranteed to have at least 20 slots. -The entries in -the descriptor table are numbered with small integers starting at 0. The .Fn getdtablesize -system call returns the size of this table. +system call returns the maximum number of file descriptors +that the current process may open. +The maximum file descriptor number that the system may assign +is the return value minus one. +Existing file descriptor numbers may be higher +if the limit was lowered after they were opened. .Sh SEE ALSO .Xr close 2 , +.Xr closefrom 2 , .Xr dup 2 , -.Xr open 2 , -.Xr select 2 +.Xr getrlimit 2 , +.Xr sysconf 2 .Sh HISTORY The .Fn getdtablesize