xref: /illumos-gate/usr/src/man/man3c/getdtablesize.3c (revision 8a2b682e57a046b828f37bcde1776f131ef4629f)

Sun Microsystems, Inc. gratefully acknowledges The Open Group for
permission to reproduce portions of its copyrighted documentation.
Original documentation from The Open Group can be obtained online at
http://www.opengroup.org/bookstore/.

The Institute of Electrical and Electronics Engineers and The Open
Group, have given us permission to reprint portions of their
documentation.

In the following statement, the phrase ``this text'' refers to portions
of the system documentation.

Portions of this text are reprinted and reproduced in electronic form
in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
Standard for Information Technology -- Portable Operating System
Interface (POSIX), The Open Group Base Specifications Issue 6,
Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
Engineers, Inc and The Open Group. In the event of any discrepancy
between these versions and the original IEEE and The Open Group
Standard, the original IEEE and The Open Group Standard is the referee
document. The original Standard can be obtained online at
http://www.opengroup.org/unix/online.html.

This notice shall appear on any product containing this material.

The Berkeley software License Agreement specifies the terms and conditions
for redistribution.


Copyright (c) 1983 Regents of the University of California.
All rights reserved.
Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved.

GETDTABLESIZE 3C "Mar 1, 1996"
NAME
getdtablesize - get the file descriptor table size
SYNOPSIS

#include <unistd.h>

int getdtablesize(void);
DESCRIPTION

The getdtablesize() function is equivalent to getrlimit(2) with the RLIMIT_NOFILE option.

RETURN VALUES

The getdtablesize() function returns the current soft limit as if obtained from a call to getrlimit() with the RLIMIT_NOFILE option.

ERRORS

No errors are defined.

USAGE

There is no direct relationship between the value returned by getdtablesize() and OPEN_MAX defined in <limits.h>.

Each process has a file 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 getdtablesize() function returns the current maximum size of this table by calling the getrlimit() function.

SEE ALSO

close(2), getrlimit(2), open(2), setrlimit(2), select(3C)