1GETDTABLESIZE(3)           Linux Programmer's Manual          GETDTABLESIZE(3)
2
3
4

NAME

6       getdtablesize - get file descriptor table size
7

SYNOPSIS

9       #include <unistd.h>
10
11       int getdtablesize(void);
12
13   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
14
15       getdtablesize():
16           Since glibc 2.12:
17               /* Glibc since 2.19: */ _DEFAULT_SOURCE
18                   || /* Glibc versions <= 2.19: */ _BSD_SOURCE
19                   || ! (_POSIX_C_SOURCE >= 200112L)
20           Before glibc 2.12:
21               _BSD_SOURCE || _XOPEN_SOURCE >= 500
22

DESCRIPTION

24       getdtablesize()  returns the maximum number of files a process can have
25       open, one more than the largest possible value for a file descriptor.
26

RETURN VALUE

28       The current limit on the number of open files per process.
29

ERRORS

31       On Linux, getdtablesize() can return any of the  errors  described  for
32       getrlimit(2); see NOTES below.
33

ATTRIBUTES

35       For   an   explanation   of   the  terms  used  in  this  section,  see
36       attributes(7).
37
38       ┌────────────────┬───────────────┬─────────┐
39Interface       Attribute     Value   
40       ├────────────────┼───────────────┼─────────┤
41getdtablesize() │ Thread safety │ MT-Safe │
42       └────────────────┴───────────────┴─────────┘

CONFORMING TO

44       SVr4, 4.4BSD (the getdtablesize() function first appeared  in  4.2BSD).
45       It  is  not  specified  in POSIX.1; portable applications should employ
46       sysconf(_SC_OPEN_MAX) instead of this call.
47

NOTES

49       The glibc version of getdtablesize() calls getrlimit(2) and returns the
50       current RLIMIT_NOFILE limit, or OPEN_MAX when that fails.
51

SEE ALSO

53       close(2), dup(2), getrlimit(2), open(2)
54

COLOPHON

56       This  page  is  part of release 5.07 of the Linux man-pages project.  A
57       description of the project, information about reporting bugs,  and  the
58       latest     version     of     this    page,    can    be    found    at
59       https://www.kernel.org/doc/man-pages/.
60
61
62
63Linux                             2020-06-09                  GETDTABLESIZE(3)
Impressum