]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/getdtablesize.3
locale.1, localedef.1, _exit.2, accept.2, access.2, acct.2, adjtimex.2, bdflush.2...
[thirdparty/man-pages.git] / man3 / getdtablesize.3
CommitLineData
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 29getdtablesize \- get file descriptor table size
fea681da
MK
30.SH SYNOPSIS
31.B #include <unistd.h>
32.sp
33.B int getdtablesize(void);
cc4615cc
MK
34.sp
35.in -4n
36Feature 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
45Since 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
52Before 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
60returns the maximum number of files a process can have open,
61one more than the largest possible value for a file descriptor.
47297adb 62.SH RETURN VALUE
fea681da 63The current limit on the number of open files per process.
a9a79c6e
MK
64.SH ERRORS
65On Linux,
66.BR getdtablesize ()
67can return any of the errors described for
68.BR getrlimit (2);
69see NOTES below.
2d89d613 70.SH ATTRIBUTES
b93455f3
MK
71For an explanation of the terms used in this section, see
72.BR attributes (7).
73.TS
74allbox;
75lb lb lb
76l l l.
77Interface Attribute Value
78T{
2d89d613 79.BR getdtablesize ()
b93455f3
MK
80T} Thread safety MT-Safe
81.TE
47297adb 82.SH CONFORMING TO
a1d5f77c
MK
83SVr4, 4.4BSD (the
84.BR getdtablesize ()
85function first appeared in 4.2BSD).
ef863799 86It is not specified in POSIX.1;
a1d5f77c
MK
87portable applications should employ
88.I sysconf(_SC_OPEN_MAX)
89instead of this call.
fea681da 90.SH NOTES
e511ffb6 91.BR getdtablesize ()
c13182ef
MK
92is implemented as a libc library function.
93The glibc version calls
fea681da
MK
94.BR getrlimit (2)
95and returns the current
96.B RLIMIT_NOFILE
97limit, or
98.B OPEN_MAX
99when 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)