OSDN Git Service

278f92f3ddb5c4af382925e6eeb9b6fd0ec749ae
[linuxjm/LDP_man-pages.git] / draft / man2 / getdtablesize.2
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.
13 .\"
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.
21 .\"
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 .\"
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>
33 .\"
34 .TH GETDTABLESIZE 2 2010-09-20 "Linux" "Linux Programmer's Manual"
35 .\"O .SH NAME
36 .SH Ì¾Á°
37 .\"O getdtablesize \- get descriptor table size
38 getdtablesize \- ¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¦¥Æ¡¼¥Ö¥ë¤Î¥µ¥¤¥º¤ò¼èÆÀ¤¹¤ë
39 .\"O .SH SYNOPSIS
40 .SH ½ñ¼°
41 .B #include <unistd.h>
42 .sp
43 .B int getdtablesize(void);
44 .sp
45 .in -4n
46 .\"O Feature Test Macro Requirements for glibc (see
47 .\"O .BR feature_test_macros (7)):
48 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
49 .RB ( feature_test_macros (7)
50 »²¾È):
51 .in
52 .sp
53 .BR getdtablesize ():
54 .ad l
55 .RS 4
56 .PD 0
57 .TP 4
58 .\"O Since glibc 2.12:
59 glibc 2.12 °Ê¹ß:
60 .nf
61 _BSD_SOURCE ||
62     !(_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600)
63 .fi
64 .TP 4
65 .\"O Before glibc 2.12:
66 glibc 2.12 ¤è¤êÁ°:
67 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
68 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
69 .PD
70 .RE
71 .ad b
72 .\"O .SH DESCRIPTION
73 .SH ÀâÌÀ
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.
77 .BR getdtablesize ()
78 ¤Ï 1 ¤Ä¤Î¥×¥í¥»¥¹¤Î¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤ÎºÇÂçÃͤòÊÖ¤¹¡£
79 ÊÖ¤êÃͤϥե¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¼è¤êÆÀ¤ëºÇÂçÃͤè¤ê 1 Â礭¤¤ÃͤǤ¢¤ë¡£
80 .\"O .SH "RETURN VALUE"
81 .SH ÊÖ¤êÃÍ
82 .\"O The current limit on the number of open files per process.
83 ¥×¥í¥»¥¹Ëè¤Ë¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤Î¸½ºß¤ÎÀ©¸ÂÃÍ¡£
84 .\"O .SH ERRORS
85 .SH ¥¨¥é¡¼
86 .\"O On Linux,
87 .\"O .BR getdtablesize ()
88 .\"O can return any of the errors described for
89 .\"O .BR getrlimit (2);
90 .\"O see NOTES below.
91 Linux ¤Ç¤Ï¡¢
92 .BR getdtablesize ()
93 ¤Ï
94 .BR getrlimit (2)
95 ¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤òÊÖ¤¹¤³¤È¤¬¤¢¤ë¡£
96 ²¼µ­¤Î¡ÖÃí°Õ¡×¤ò»²¾È¤Î¤³¤È¡£
97 .\"O .SH "CONFORMING TO"
98 .SH ½àµò
99 .\"O SVr4, 4.4BSD (the
100 .\"O .BR getdtablesize ()
101 .\"O function first appeared in 4.2BSD).
102 SVr4, 4.4BSD
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)
112 ¤ò»È¤¦¤Ù¤­¤Ç¤¢¤ë¡£
113 .\"O .SH NOTES
114 .SH Ãí°Õ
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
121 .\"O limit, or
122 .\"O .B OPEN_MAX
123 .\"O when that fails.
124 .BR getdtablesize ()
125 ¤Ï libc ¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£glibc ÈǤÏ
126 .BR getrlimit (2)
127 ¤ò¸Æ¤Ó½Ð¤·¤Æ¡¢¸½ºß¤Î
128 .B RLIMIT_NOFILE
129 ¤òÊÖ¤¹¡£
130 ¸Æ¤Ó½Ð¤·¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ï
131 .B OPEN_MAX
132 ¤òÊÖ¤¹¡£
133 .\"O The libc4 and libc5 versions return
134 .\"O .B OPEN_MAX
135 .\"O (set to 256 since Linux 0.98.4).
136 libc4 ¤È libc5 ¤Ç¤Ï
137 .B OPEN_MAX
138 (Linux 0.98.4 °Ê¹ß¤Ç¤Ï 256 ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë)
139 ¤òÊÖ¤¹¡£
140 .\"O .SH "SEE ALSO"
141 .SH ´ØÏ¢¹àÌÜ
142 .BR close (2),
143 .BR dup (2),
144 .BR getrlimit (2),
145 .BR open (2)