getdtablesize(2) System Calls Manual getdtablesize(2)NAME
getdtablesize - Gets the descriptor table size
SYNOPSIS
#include <unistd.h>
int getdtablesize ( void );
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
getdtablesize(): XPG4-UNIX
Refer to the standards(5) reference page for more information about industry standards and associated tags.
DESCRIPTION
The getdtablesize() function returns the total number of file descriptors in a process' descriptor table. Each process has a fixed size
descriptor table that is guaranteed to have at least 64 slots. The entries in the descriptor table are numbered with small integers start-
ing at 0 (zero).
The getdtablesize() function returns the total number of file descriptors that a process can have open simultaneously. Each process is
limited to a fixed number of open file descriptors. This limit is at least 64. The system defined limit is configurable. If it is
greater than 64, the system will allocate more file descriptors for a process up to the defined maximum.
RETURN VALUES
The getdtablesize() function returns the size of the descriptor table, and is always successful.
RELATED INFORMATION
Functions: close(2), open(2), select(2)
Standards: standards(5) delim off
getdtablesize(2)
Check Out this Related Man Page
getdtablesize(3C) Standard C Library Functions 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)SunOS 5.11 1 Mar 1996 getdtablesize(3C)
Hi,
I have written a daemon process, to perform certain operations in the background.
For this I have to close, the open file descriptors,
Does anybody know how to find out the number of open file descriptors ?
Thanks in Advance,
Sheetal (2 Replies)
#cat /proc/sys/fs/file-nr
5304 0 176845
its said that :
1st value is: total allocated file descriptors
2nd value: total free allocated file descriptors
3rd value: maximum number of file descriptors allowed on the system
But I always get the value of 2nd column as 0. Does that mean... (1 Reply)