]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Hey Emacs! This file is -*- nroff -*- source. |
2 | .\" | |
3 | .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) | |
4 | .\" | |
5 | .\" Permission is granted to make and distribute verbatim copies of this | |
6 | .\" manual provided the copyright notice and this permission notice are | |
7 | .\" preserved on all copies. | |
8 | .\" | |
9 | .\" Permission is granted to copy and distribute modified versions of this | |
10 | .\" manual under the conditions for verbatim copying, provided that the | |
11 | .\" entire resulting derived work is distributed under the terms of a | |
12 | .\" permission notice identical to this one. | |
c13182ef | 13 | .\" |
fea681da MK |
14 | .\" Since the Linux kernel and libraries are constantly changing, this |
15 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
16 | .\" responsibility for errors or omissions, or for damages resulting from | |
17 | .\" the use of the information contained herein. The author(s) may not | |
18 | .\" have taken the same level of care in the production of this manual, | |
19 | .\" which is licensed free of charge, as they might when working | |
20 | .\" professionally. | |
c13182ef | 21 | .\" |
fea681da MK |
22 | .\" Formatted or processed versions of this manual, if unaccompanied by |
23 | .\" the source, must acknowledge the copyright and authors of this work. | |
24 | .\" | |
25 | .\" Modified 2002-04-15 by Roger Luethi <rl@hellgate.ch> and aeb | |
26 | .\" | |
cc4615cc | 27 | .TH GETDTABLESIZE 2 2007-07-26 "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 (): | |
41 | _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 | |
fea681da | 42 | .SH DESCRIPTION |
e511ffb6 | 43 | .BR getdtablesize () |
fea681da MK |
44 | returns the maximum number of files a process can have open, |
45 | one more than the largest possible value for a file descriptor. | |
46 | .SH "RETURN VALUE" | |
47 | The current limit on the number of open files per process. | |
a9a79c6e MK |
48 | .SH ERRORS |
49 | On Linux, | |
50 | .BR getdtablesize () | |
51 | can return any of the errors described for | |
52 | .BR getrlimit (2); | |
53 | see NOTES below. | |
a1d5f77c MK |
54 | .SH "CONFORMING TO" |
55 | SVr4, 4.4BSD (the | |
56 | .BR getdtablesize () | |
57 | function first appeared in 4.2BSD). | |
58 | It is not specified in POSIX.1-2001; | |
59 | portable applications should employ | |
60 | .I sysconf(_SC_OPEN_MAX) | |
61 | instead of this call. | |
fea681da | 62 | .SH NOTES |
e511ffb6 | 63 | .BR getdtablesize () |
c13182ef MK |
64 | is implemented as a libc library function. |
65 | The glibc version 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. | |
72 | The libc4 and libc5 versions return | |
73 | .B OPEN_MAX | |
74 | (set to 256 since Linux 0.98.4). | |
fea681da MK |
75 | .SH "SEE ALSO" |
76 | .BR close (2), | |
77 | .BR dup (2), | |
78 | .BR getrlimit (2), | |
79 | .BR open (2) |