]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/getdtablesize.2
chroot.2: Added feature test macro requirements
[thirdparty/man-pages.git] / man2 / getdtablesize.2
CommitLineData
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
29getdtablesize \- 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
36Feature 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
44returns the maximum number of files a process can have open,
45one more than the largest possible value for a file descriptor.
46.SH "RETURN VALUE"
47The current limit on the number of open files per process.
a9a79c6e
MK
48.SH ERRORS
49On Linux,
50.BR getdtablesize ()
51can return any of the errors described for
52.BR getrlimit (2);
53see NOTES below.
a1d5f77c
MK
54.SH "CONFORMING TO"
55SVr4, 4.4BSD (the
56.BR getdtablesize ()
57function first appeared in 4.2BSD).
58It is not specified in POSIX.1-2001;
59portable applications should employ
60.I sysconf(_SC_OPEN_MAX)
61instead of this call.
fea681da 62.SH NOTES
e511ffb6 63.BR getdtablesize ()
c13182ef
MK
64is implemented as a libc library function.
65The glibc version calls
fea681da
MK
66.BR getrlimit (2)
67and returns the current
68.B RLIMIT_NOFILE
69limit, or
70.B OPEN_MAX
71when that fails.
72The 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)