]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) |
2 | .\" | |
93015253 | 3 | .\" %%%LICENSE_START(VERBATIM) |
fea681da MK |
4 | .\" Permission is granted to make and distribute verbatim copies of this |
5 | .\" manual provided the copyright notice and this permission notice are | |
6 | .\" preserved on all copies. | |
7 | .\" | |
8 | .\" Permission is granted to copy and distribute modified versions of this | |
9 | .\" manual under the conditions for verbatim copying, provided that the | |
10 | .\" entire resulting derived work is distributed under the terms of a | |
11 | .\" permission notice identical to this one. | |
c13182ef | 12 | .\" |
fea681da MK |
13 | .\" Since the Linux kernel and libraries are constantly changing, this |
14 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
15 | .\" responsibility for errors or omissions, or for damages resulting from | |
16 | .\" the use of the information contained herein. The author(s) may not | |
17 | .\" have taken the same level of care in the production of this manual, | |
18 | .\" which is licensed free of charge, as they might when working | |
19 | .\" professionally. | |
c13182ef | 20 | .\" |
fea681da MK |
21 | .\" Formatted or processed versions of this manual, if unaccompanied by |
22 | .\" the source, must acknowledge the copyright and authors of this work. | |
4b72fb64 | 23 | .\" %%%LICENSE_END |
fea681da MK |
24 | .\" |
25 | .\" Modified 2002-04-15 by Roger Luethi <rl@hellgate.ch> and aeb | |
26 | .\" | |
97986708 | 27 | .TH GETDTABLESIZE 3 2016-03-15 "Linux" "Linux Programmer's Manual" |
fea681da | 28 | .SH NAME |
d9cb0d7d | 29 | getdtablesize \- get file descriptor table size |
fea681da MK |
30 | .SH SYNOPSIS |
31 | .B #include <unistd.h> | |
68e4db0a | 32 | .PP |
fea681da | 33 | .B int getdtablesize(void); |
68e4db0a | 34 | .PP |
cc4615cc MK |
35 | .in -4n |
36 | Feature Test Macro Requirements for glibc (see | |
37 | .BR feature_test_macros (7)): | |
38 | .in | |
68e4db0a | 39 | .PP |
cc4615cc | 40 | .BR getdtablesize (): |
2df50e3d MK |
41 | .ad l |
42 | .RS 4 | |
43 | .PD 0 | |
44 | .TP 4 | |
45 | Since glibc 2.12: | |
46 | .nf | |
6e0869f7 MK |
47 | /* Glibc since 2.19: */ _DEFAULT_SOURCE |
48 | || /* Glibc versions <= 2.19: */ _BSD_SOURCE | |
49 | || ! (_POSIX_C_SOURCE\ >=\ 200112L) | |
2df50e3d MK |
50 | .TP 4 |
51 | .fi | |
52 | Before glibc 2.12: | |
cf7fa0a1 MK |
53 | _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 |
54 | .\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED | |
2df50e3d MK |
55 | .PD |
56 | .RE | |
57 | .ad b | |
fea681da | 58 | .SH DESCRIPTION |
e511ffb6 | 59 | .BR getdtablesize () |
fea681da MK |
60 | returns the maximum number of files a process can have open, |
61 | one more than the largest possible value for a file descriptor. | |
47297adb | 62 | .SH RETURN VALUE |
fea681da | 63 | The current limit on the number of open files per process. |
a9a79c6e MK |
64 | .SH ERRORS |
65 | On Linux, | |
66 | .BR getdtablesize () | |
67 | can return any of the errors described for | |
68 | .BR getrlimit (2); | |
69 | see NOTES below. | |
2d89d613 | 70 | .SH ATTRIBUTES |
b93455f3 MK |
71 | For an explanation of the terms used in this section, see |
72 | .BR attributes (7). | |
73 | .TS | |
74 | allbox; | |
75 | lb lb lb | |
76 | l l l. | |
77 | Interface Attribute Value | |
78 | T{ | |
2d89d613 | 79 | .BR getdtablesize () |
b93455f3 MK |
80 | T} Thread safety MT-Safe |
81 | .TE | |
47297adb | 82 | .SH CONFORMING TO |
a1d5f77c MK |
83 | SVr4, 4.4BSD (the |
84 | .BR getdtablesize () | |
85 | function first appeared in 4.2BSD). | |
ef863799 | 86 | It is not specified in POSIX.1; |
a1d5f77c MK |
87 | portable applications should employ |
88 | .I sysconf(_SC_OPEN_MAX) | |
89 | instead of this call. | |
fea681da | 90 | .SH NOTES |
e511ffb6 | 91 | .BR getdtablesize () |
c13182ef MK |
92 | is implemented as a libc library function. |
93 | The glibc version calls | |
fea681da MK |
94 | .BR getrlimit (2) |
95 | and returns the current | |
96 | .B RLIMIT_NOFILE | |
97 | limit, or | |
98 | .B OPEN_MAX | |
99 | when that fails. | |
7e693a49 MK |
100 | .\" The libc4 and libc5 versions return |
101 | .\" .B OPEN_MAX | |
102 | .\" (set to 256 since Linux 0.98.4). | |
47297adb | 103 | .SH SEE ALSO |
fea681da MK |
104 | .BR close (2), |
105 | .BR dup (2), | |
106 | .BR getrlimit (2), | |
107 | .BR open (2) |