]>
Commit | Line | Data |
---|---|---|
a1eaacb1 | 1 | '\" t |
fea681da MK |
2 | .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) |
3 | .\" | |
5fbde956 | 4 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
fea681da MK |
5 | .\" |
6 | .\" Modified 2002-04-15 by Roger Luethi <rl@hellgate.ch> and aeb | |
7 | .\" | |
4c1c5274 | 8 | .TH getdtablesize 3 (date) "Linux man-pages (unreleased)" |
fea681da | 9 | .SH NAME |
d9cb0d7d | 10 | getdtablesize \- get file descriptor table size |
42009080 AC |
11 | .SH LIBRARY |
12 | Standard C library | |
13 | .RI ( libc ", " \-lc ) | |
fea681da | 14 | .SH SYNOPSIS |
4653ec6e | 15 | .nf |
fea681da | 16 | .B #include <unistd.h> |
c6d039a3 | 17 | .P |
fea681da | 18 | .B int getdtablesize(void); |
4653ec6e | 19 | .fi |
c6d039a3 | 20 | .P |
d39ad78f | 21 | .RS -4 |
cc4615cc MK |
22 | Feature Test Macro Requirements for glibc (see |
23 | .BR feature_test_macros (7)): | |
d39ad78f | 24 | .RE |
c6d039a3 | 25 | .P |
cc4615cc | 26 | .BR getdtablesize (): |
2df50e3d | 27 | .nf |
3754620f | 28 | Since glibc 2.20: |
9e8a25d7 | 29 | _DEFAULT_SOURCE || ! (_POSIX_C_SOURCE >= 200112L) |
75c018a1 | 30 | glibc 2.12 to glibc 2.19: |
9e8a25d7 MK |
31 | _BSD_SOURCE || ! (_POSIX_C_SOURCE >= 200112L) |
32 | Before glibc 2.12: | |
5c10d2c5 MK |
33 | _BSD_SOURCE || _XOPEN_SOURCE >= 500 |
34 | .\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED | |
2df50e3d | 35 | .fi |
fea681da | 36 | .SH DESCRIPTION |
e511ffb6 | 37 | .BR getdtablesize () |
fea681da MK |
38 | returns the maximum number of files a process can have open, |
39 | one more than the largest possible value for a file descriptor. | |
47297adb | 40 | .SH RETURN VALUE |
fea681da | 41 | The current limit on the number of open files per process. |
a9a79c6e MK |
42 | .SH ERRORS |
43 | On Linux, | |
44 | .BR getdtablesize () | |
45 | can return any of the errors described for | |
46 | .BR getrlimit (2); | |
47 | see NOTES below. | |
2d89d613 | 48 | .SH ATTRIBUTES |
b93455f3 MK |
49 | For an explanation of the terms used in this section, see |
50 | .BR attributes (7). | |
51 | .TS | |
52 | allbox; | |
c466875e | 53 | lbx lb lb |
b93455f3 MK |
54 | l l l. |
55 | Interface Attribute Value | |
56 | T{ | |
9e54434e BR |
57 | .na |
58 | .nh | |
2d89d613 | 59 | .BR getdtablesize () |
b93455f3 MK |
60 | T} Thread safety MT-Safe |
61 | .TE | |
4131356c | 62 | .SH VERSIONS |
af52fb48 | 63 | The glibc version of |
e511ffb6 | 64 | .BR getdtablesize () |
af52fb48 | 65 | calls |
fea681da MK |
66 | .BR getrlimit (2) |
67 | and returns the current | |
68 | .B RLIMIT_NOFILE | |
69 | limit, or | |
70 | .B OPEN_MAX | |
71 | when that fails. | |
7e693a49 MK |
72 | .\" The libc4 and libc5 versions return |
73 | .\" .B OPEN_MAX | |
74 | .\" (set to 256 since Linux 0.98.4). | |
c6d039a3 | 75 | .P |
4131356c AC |
76 | Portable applications should employ |
77 | .I sysconf(_SC_OPEN_MAX) | |
78 | instead of this call. | |
79 | .SH STANDARDS | |
80 | None. | |
81 | .SH HISTORY | |
82 | SVr4, 4.4BSD | |
83 | (first appeared in 4.2BSD). | |
47297adb | 84 | .SH SEE ALSO |
fea681da MK |
85 | .BR close (2), |
86 | .BR dup (2), | |
87 | .BR getrlimit (2), | |
88 | .BR open (2) |