]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/getdtablesize.3
Many pages: Use correct letter case in page titles (TH)
[thirdparty/man-pages.git] / man3 / getdtablesize.3
1 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .\" Modified 2002-04-15 by Roger Luethi <rl@hellgate.ch> and aeb
6 .\"
7 .TH getdtablesize 3 (date) "Linux man-pages (unreleased)"
8 .SH NAME
9 getdtablesize \- get file descriptor table size
10 .SH LIBRARY
11 Standard C library
12 .RI ( libc ", " \-lc )
13 .SH SYNOPSIS
14 .nf
15 .B #include <unistd.h>
16 .PP
17 .B int getdtablesize(void);
18 .fi
19 .PP
20 .RS -4
21 Feature Test Macro Requirements for glibc (see
22 .BR feature_test_macros (7)):
23 .RE
24 .PP
25 .BR getdtablesize ():
26 .nf
27 Since glibc 2.20:
28 _DEFAULT_SOURCE || ! (_POSIX_C_SOURCE >= 200112L)
29 Glibc 2.12 to 2.19:
30 _BSD_SOURCE || ! (_POSIX_C_SOURCE >= 200112L)
31 Before glibc 2.12:
32 _BSD_SOURCE || _XOPEN_SOURCE >= 500
33 .\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
34 .fi
35 .SH DESCRIPTION
36 .BR getdtablesize ()
37 returns the maximum number of files a process can have open,
38 one more than the largest possible value for a file descriptor.
39 .SH RETURN VALUE
40 The current limit on the number of open files per process.
41 .SH ERRORS
42 On Linux,
43 .BR getdtablesize ()
44 can return any of the errors described for
45 .BR getrlimit (2);
46 see NOTES below.
47 .SH ATTRIBUTES
48 For an explanation of the terms used in this section, see
49 .BR attributes (7).
50 .ad l
51 .nh
52 .TS
53 allbox;
54 lbx lb lb
55 l l l.
56 Interface Attribute Value
57 T{
58 .BR getdtablesize ()
59 T} Thread safety MT-Safe
60 .TE
61 .hy
62 .ad
63 .sp 1
64 .SH STANDARDS
65 SVr4, 4.4BSD (the
66 .BR getdtablesize ()
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)
71 instead of this call.
72 .SH NOTES
73 The glibc version of
74 .BR getdtablesize ()
75 calls
76 .BR getrlimit (2)
77 and returns the current
78 .B RLIMIT_NOFILE
79 limit, or
80 .B OPEN_MAX
81 when that fails.
82 .\" The libc4 and libc5 versions return
83 .\" .B OPEN_MAX
84 .\" (set to 256 since Linux 0.98.4).
85 .SH SEE ALSO
86 .BR close (2),
87 .BR dup (2),
88 .BR getrlimit (2),
89 .BR open (2)