]>
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 | .\" | |
6df94599 | 27 | .TH GETDTABLESIZE 3 2013-02-05 "Linux" "Linux Programmer's Manual" |
fea681da MK |
28 | .SH NAME |
29 | getdtablesize \- get descriptor table size | |
30 | .SH SYNOPSIS | |
31 | .B #include <unistd.h> | |
32 | .sp | |
33 | .B int getdtablesize(void); | |
cc4615cc MK |
34 | .sp |
35 | .in -4n | |
36 | Feature Test Macro Requirements for glibc (see | |
37 | .BR feature_test_macros (7)): | |
38 | .in | |
39 | .sp | |
40 | .BR getdtablesize (): | |
2df50e3d MK |
41 | .ad l |
42 | .RS 4 | |
43 | .PD 0 | |
44 | .TP 4 | |
45 | Since glibc 2.12: | |
46 | .nf | |
47 | _BSD_SOURCE || | |
98dbe7af | 48 | !(_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600) |
2df50e3d MK |
49 | .TP 4 |
50 | .fi | |
51 | Before glibc 2.12: | |
98dbe7af MK |
52 | _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || |
53 | _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED | |
2df50e3d MK |
54 | .PD |
55 | .RE | |
56 | .ad b | |
fea681da | 57 | .SH DESCRIPTION |
e511ffb6 | 58 | .BR getdtablesize () |
fea681da MK |
59 | returns the maximum number of files a process can have open, |
60 | one more than the largest possible value for a file descriptor. | |
47297adb | 61 | .SH RETURN VALUE |
fea681da | 62 | The current limit on the number of open files per process. |
a9a79c6e MK |
63 | .SH ERRORS |
64 | On Linux, | |
65 | .BR getdtablesize () | |
66 | can return any of the errors described for | |
67 | .BR getrlimit (2); | |
68 | see NOTES below. | |
47297adb | 69 | .SH CONFORMING TO |
a1d5f77c MK |
70 | SVr4, 4.4BSD (the |
71 | .BR getdtablesize () | |
72 | function first appeared in 4.2BSD). | |
73 | It is not specified in POSIX.1-2001; | |
74 | portable applications should employ | |
75 | .I sysconf(_SC_OPEN_MAX) | |
76 | instead of this call. | |
fea681da | 77 | .SH NOTES |
e511ffb6 | 78 | .BR getdtablesize () |
c13182ef MK |
79 | is implemented as a libc library function. |
80 | The glibc version calls | |
fea681da MK |
81 | .BR getrlimit (2) |
82 | and returns the current | |
83 | .B RLIMIT_NOFILE | |
84 | limit, or | |
85 | .B OPEN_MAX | |
86 | when that fails. | |
87 | The libc4 and libc5 versions return | |
88 | .B OPEN_MAX | |
89 | (set to 256 since Linux 0.98.4). | |
47297adb | 90 | .SH SEE ALSO |
fea681da MK |
91 | .BR close (2), |
92 | .BR dup (2), | |
93 | .BR getrlimit (2), | |
94 | .BR open (2) |