getdtablesize() — Get the file descriptor table size
Standards
Standards / Extensions | C or C++ | Dependencies |
---|---|---|
XPG4.2 | both |
Format
#define _XOPEN_SOURCE_EXTENDED 1
#include <unistd.h>
int getdtablesize(void);
General description
The getdtablesize() function is equivalent to getrlimit() with the RLIMIT_NOFILE option.
This function is kept for historical reasons. It was part of the Legacy Feature in Single UNIX Specification, Version 2, but has been withdrawn and is not supported as part of Single UNIX Specification, Version 3. New applications should use getrlimit() instead of getdtablesize().
If it is necessary to continue using this function in an application written for Single UNIX Specification, Version 3, define the feature test macro _UNIX03_WITHDRAWN before including any standard system headers. The macro exposes all interfaces and symbols removed in Single UNIX Specification, Version 3.
Returned value
getdtablesize() returns the current soft limit as if obtained from a call to getrlimit().
There are no errno values defined.