1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
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.
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.
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
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" Modified 2002-04-15 by Roger Luethi <rl@hellgate.ch> and aeb
27 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
28 .\" all rights reserved.
29 .\" Translated Sat Feb 22 20:20:24 JST 1997
30 .\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
31 .\" Updated 2002-10-14 by Kentaro Shirakata <argrath@ub32.org>
32 .\" Updated 2007-01-01 by Kentaro Shirakata <argrath@ub32.org>
34 .TH GETDTABLESIZE 2 2010-09-20 "Linux" "Linux Programmer's Manual"
37 .\"O getdtablesize \- get descriptor table size
38 getdtablesize \- ¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¦¥Æ¡¼¥Ö¥ë¤Î¥µ¥¤¥º¤ò¼èÆÀ¤¹¤ë
41 .B #include <unistd.h>
43 .B int getdtablesize(void);
46 .\"O Feature Test Macro Requirements for glibc (see
47 .\"O .BR feature_test_macros (7)):
48 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
49 .RB ( feature_test_macros (7)
58 .\"O Since glibc 2.12:
62 !(_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600)
65 .\"O Before glibc 2.12:
67 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
68 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
74 .\"O .BR getdtablesize ()
75 .\"O returns the maximum number of files a process can have open,
76 .\"O one more than the largest possible value for a file descriptor.
78 ¤Ï 1 ¤Ä¤Î¥×¥í¥»¥¹¤Î¥ª¡¼¥×¥ó¤Ç¤¤ë¥Õ¥¡¥¤¥ë¿ô¤ÎºÇÂçÃͤòÊÖ¤¹¡£
79 ÊÖ¤êÃͤϥե¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¼è¤êÆÀ¤ëºÇÂçÃͤè¤ê 1 Â礤¤ÃͤǤ¢¤ë¡£
80 .\"O .SH "RETURN VALUE"
82 .\"O The current limit on the number of open files per process.
83 ¥×¥í¥»¥¹Ëè¤Ë¥ª¡¼¥×¥ó¤Ç¤¤ë¥Õ¥¡¥¤¥ë¿ô¤Î¸½ºß¤ÎÀ©¸ÂÃÍ¡£
87 .\"O .BR getdtablesize ()
88 .\"O can return any of the errors described for
89 .\"O .BR getrlimit (2);
95 ¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤òÊÖ¤¹¤³¤È¤¬¤¢¤ë¡£
96 ²¼µ¤Î¡ÖÃí°Õ¡×¤ò»²¾È¤Î¤³¤È¡£
97 .\"O .SH "CONFORMING TO"
99 .\"O SVr4, 4.4BSD (the
100 .\"O .BR getdtablesize ()
101 .\"O function first appeared in 4.2BSD).
103 .RB ( getdtablesize ()
104 ´Ø¿ô¤Ï 4.2BSD ¤ÇºÇ½é¤Ë¸½¤ï¤ì¤¿)¡£
105 .\"O It is not specified in POSIX.1-2001;
106 .\"O portable applications should employ
107 .\"O .I sysconf(_SC_OPEN_MAX)
108 .\"O instead of this call.
109 ¤³¤ì¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢
110 °Ü¿¢À¤Î¤¢¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¤³¤Î¸Æ¤Ó½Ð¤·¤ÎÂå¤ï¤ê¤Ë
111 .I sysconf(_SC_OPEN_MAX)
115 .\"O .BR getdtablesize ()
116 .\"O is implemented as a libc library function.
117 .\"O The glibc version calls
118 .\"O .BR getrlimit (2)
119 .\"O and returns the current
120 .\"O .B RLIMIT_NOFILE
123 .\"O when that fails.
125 ¤Ï libc ¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£glibc ÈǤÏ
130 ¸Æ¤Ó½Ð¤·¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ï
133 .\"O The libc4 and libc5 versions return
135 .\"O (set to 256 since Linux 0.98.4).
138 (Linux 0.98.4 °Ê¹ß¤Ç¤Ï 256 ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë)