man pages section 3: Basic Library Functions

Exit Print View

Updated: July 2014
 
 

getdtablesize(3C)

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)