1 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\" Modified 2002-04-15 by Roger Luethi <rl@hellgate.ch> and aeb
7 .TH getdtablesize 3 (date) "Linux man-pages (unreleased)"
9 getdtablesize \- get file descriptor table size
12 .RI ( libc ", " \-lc )
15 .B #include <unistd.h>
17 .B int getdtablesize(void);
21 Feature Test Macro Requirements for glibc (see
22 .BR feature_test_macros (7)):
28 _DEFAULT_SOURCE || ! (_POSIX_C_SOURCE >= 200112L)
30 _BSD_SOURCE || ! (_POSIX_C_SOURCE >= 200112L)
32 _BSD_SOURCE || _XOPEN_SOURCE >= 500
33 .\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
37 returns the maximum number of files a process can have open,
38 one more than the largest possible value for a file descriptor.
40 The current limit on the number of open files per process.
44 can return any of the errors described for
48 For an explanation of the terms used in this section, see
56 Interface Attribute Value
59 T} Thread safety MT-Safe
67 function first appeared in 4.2BSD).
68 It is not specified in POSIX.1;
69 portable applications should employ
70 .I sysconf(_SC_OPEN_MAX)
77 and returns the current
82 .\" The libc4 and libc5 versions return
84 .\" (set to 256 since Linux 0.98.4).