]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/getdtablesize.3
man*/: srcfix (Use .P instead of .PP or .LP)
[thirdparty/man-pages.git] / man3 / getdtablesize.3
CommitLineData
a1eaacb1 1'\" t
fea681da
MK
2.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
3.\"
5fbde956 4.\" SPDX-License-Identifier: Linux-man-pages-copyleft
fea681da
MK
5.\"
6.\" Modified 2002-04-15 by Roger Luethi <rl@hellgate.ch> and aeb
7.\"
4c1c5274 8.TH getdtablesize 3 (date) "Linux man-pages (unreleased)"
fea681da 9.SH NAME
d9cb0d7d 10getdtablesize \- get file descriptor table size
42009080
AC
11.SH LIBRARY
12Standard C library
13.RI ( libc ", " \-lc )
fea681da 14.SH SYNOPSIS
4653ec6e 15.nf
fea681da 16.B #include <unistd.h>
c6d039a3 17.P
fea681da 18.B int getdtablesize(void);
4653ec6e 19.fi
c6d039a3 20.P
d39ad78f 21.RS -4
cc4615cc
MK
22Feature Test Macro Requirements for glibc (see
23.BR feature_test_macros (7)):
d39ad78f 24.RE
c6d039a3 25.P
cc4615cc 26.BR getdtablesize ():
2df50e3d 27.nf
3754620f 28 Since glibc 2.20:
9e8a25d7 29 _DEFAULT_SOURCE || ! (_POSIX_C_SOURCE >= 200112L)
75c018a1 30 glibc 2.12 to glibc 2.19:
9e8a25d7
MK
31 _BSD_SOURCE || ! (_POSIX_C_SOURCE >= 200112L)
32 Before glibc 2.12:
5c10d2c5
MK
33 _BSD_SOURCE || _XOPEN_SOURCE >= 500
34.\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
2df50e3d 35.fi
fea681da 36.SH DESCRIPTION
e511ffb6 37.BR getdtablesize ()
fea681da
MK
38returns the maximum number of files a process can have open,
39one more than the largest possible value for a file descriptor.
47297adb 40.SH RETURN VALUE
fea681da 41The current limit on the number of open files per process.
a9a79c6e
MK
42.SH ERRORS
43On Linux,
44.BR getdtablesize ()
45can return any of the errors described for
46.BR getrlimit (2);
47see NOTES below.
2d89d613 48.SH ATTRIBUTES
b93455f3
MK
49For an explanation of the terms used in this section, see
50.BR attributes (7).
51.TS
52allbox;
c466875e 53lbx lb lb
b93455f3
MK
54l l l.
55Interface Attribute Value
56T{
9e54434e
BR
57.na
58.nh
2d89d613 59.BR getdtablesize ()
b93455f3
MK
60T} Thread safety MT-Safe
61.TE
4131356c 62.SH VERSIONS
af52fb48 63The glibc version of
e511ffb6 64.BR getdtablesize ()
af52fb48 65calls
fea681da
MK
66.BR getrlimit (2)
67and returns the current
68.B RLIMIT_NOFILE
69limit, or
70.B OPEN_MAX
71when that fails.
7e693a49
MK
72.\" The libc4 and libc5 versions return
73.\" .B OPEN_MAX
74.\" (set to 256 since Linux 0.98.4).
c6d039a3 75.P
4131356c
AC
76Portable applications should employ
77.I sysconf(_SC_OPEN_MAX)
78instead of this call.
79.SH STANDARDS
80None.
81.SH HISTORY
82SVr4, 4.4BSD
83(first appeared in 4.2BSD).
47297adb 84.SH SEE ALSO
fea681da
MK
85.BR close (2),
86.BR dup (2),
87.BR getrlimit (2),
88.BR open (2)