OSDN Git Service

(split) Convert release and draft pages to UTF-8.
[linuxjm/LDP_man-pages.git] / draft / man3 / opendir.3
1 .\" Copyright (C) 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" References consulted:
24 .\"     Linux libc source code
25 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26 .\"     386BSD man pages
27 .\" Modified Sat Jul 24 18:46:01 1993 by Rik Faith (faith@cs.unc.edu)
28 .\" Modified 11 June 1995 by Andries Brouwer (aeb@cwi.nl).
29 .\" 2007-07-30 Ulrich Drepper <drepper@redhat.com>: document fdopendir().
30 .\"
31 .\" Japanese Version Copyright (c) 1997 Seiichi Yoshida
32 .\"       all rights reserved.
33 .\" Translated Fri Feb 14 14:53:20 JST 1997
34 .\"         by Seiichi Yoshida <seiichi@muraoka.info.waseda.ac.jp>
35 .\" Updated & Modified Thu Feb 17 00:37:46 JST 2005
36 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
37 .\"
38 .\"WORD:    directory stream            ディレクトリストリーム
39 .\"WORD:    entry                       エントリ
40 .\"WORD:    Permission denied           アクセス権限がない
41 .\"WORD:    file descriptor             ファイルディスクリプタ
42 .\"
43 .TH OPENDIR 3  2010-06-20 "" "Linux Programmer's Manual"
44 .\"O .SH NAME
45 .SH 名前
46 .\"O opendir, fdopendir \- open a directory
47 opendir, fdopendir \- ディレクトリをオープンする
48 .\"O .SH SYNOPSIS
49 .SH 書式
50 .nf
51 .B #include <sys/types.h>
52 .br
53 .B #include <dirent.h>
54 .sp
55 .BI "DIR *opendir(const char *" name );
56 .BI "DIR *fdopendir(int " fd );
57 .fi
58 .sp
59 .in -4n
60 .\"O Feature Test Macro Requirements for glibc (see
61 .\"O .BR feature_test_macros (7)):
62 glibc 向けの機能検査マクロの要件
63 .RB ( feature_test_macros (7)
64 参照):
65 .in
66 .sp
67 .BR fdopendir ():
68 .PD 0
69 .ad l
70 .RS 4
71 .TP 4
72 .\"O Since glibc 2.10:
73 glibc 2.10 以降:
74 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
75 .TP
76 .\"O Before glibc 2.10:
77 glibc 2.10 より前:
78 _GNU_SOURCE
79 .RE
80 .ad
81 .PD
82 .\"O .SH DESCRIPTION
83 .SH 説明
84 .\"O The
85 .\"O .BR opendir ()
86 .\"O function opens a directory stream corresponding to the
87 .\"O directory \fIname\fP, and returns a pointer to the directory stream.
88 .\"O The stream is positioned at the first entry in the directory.
89 .BR opendir ()
90 関数はディレクトリ \fIname\fP に対応する
91 ディレクトリストリームをオープンし、そのストリームへのポインタを返す。
92 ストリームの位置はディレクトリの先頭のエントリに設定される。
93
94 .\"O The
95 .\"O .BR fdopendir ()
96 .\"O function
97 .\"O is like
98 .\"O .BR opendir (),
99 .\"O but returns a directory stream for the directory referred
100 .\"O to by the open file descriptor
101 .\"O .IR fd .
102 .\"O After a successful call to
103 .\"O .BR fdopendir (),
104 .\"O .I fd
105 .\"O is used internally by the implementation,
106 .\"O and should not otherwise be used by the application.
107 .BR fdopendir ()
108 関数は
109 .BR opendir ()
110 と同様だが、オープン済みのファイルディスクリプタ
111 .I fd
112 により参照されるディレクトリに対する
113 ディレクトリストリームを返す。
114 .BR fdopendir ()
115 の呼び出しが成功した後は、
116 .I fd
117 は実装の内部で使用される。アプリケーションは
118 .I fd
119 を他の場面で使用すべきではない。
120 .\"O .SH "RETURN VALUE"
121 .SH 返り値
122 .\"O The
123 .\"O .BR opendir ()
124 .\"O and
125 .\"O .BR fdopendir ()
126 .\"O functions return a pointer to the directory stream.
127 .\"O On error, NULL is returned, and
128 .\"O .I errno
129 .\"O is set appropriately.
130 関数
131 .BR opendir ()
132
133 .BR fdopendir ()
134 はディレクトリストリームへのポインタを返す。
135 エラーの場合は、NULL が返されて、
136 .I errno
137 が適切に設定される。
138 .\"O .SH ERRORS
139 .SH エラー
140 .TP
141 .B EACCES
142 .\"O Permission denied.
143 アクセス権限がない。
144 .TP
145 .B EBADF
146 .\"O .I fd
147 .\"O is not a valid file descriptor opened for reading.
148 .I fd
149 が読み出し用にオープンされた、有効なファイルディスクリプタではない。
150 .TP
151 .B EMFILE
152 .\"O Too many file descriptors in use by process.
153 プロセスが使用中のファイルディスクリプタが多すぎる。
154 .TP
155 .B ENFILE
156 .\"O Too many files are currently open in the system.
157 システムでオープンされているファイルが多すぎる。
158 .TP
159 .B ENOENT
160 .\"O Directory does not exist, or \fIname\fP is an empty string.
161 ディレクトリが存在しないか、または \fIname\fP が空文字列である。
162 .TP
163 .B ENOMEM
164 .\"O Insufficient memory to complete the operation.
165 命令を実行するのに充分なメモリがない。
166 .TP
167 .B ENOTDIR
168 .\"O \fIname\fP is not a directory.
169 \fIname\fP はディレクトリではない。
170 .\"O .SH VERSIONS
171 .SH バージョン
172 .\"O .BR fdopendir ()
173 .\"O is available in glibc since version 2.4.
174 .BR fdopendir ()
175 は glibc 2.4 以降で利用可能である。
176 .\"O .SH "CONFORMING TO"
177 .SH 準拠
178 .\"O .BR opendir ()
179 .\"O is present on SVr4, 4.3BSD, and specified in POSIX.1-2001.
180 .BR opendir ()
181 は SVr4 と 4.3BSD に存在し、
182 POSIX.1-2001 で規定されている。
183 .\"O .BR fdopendir ()
184 .\"O is specified in POSIX.1-2008.
185 .BR fdopendir ()
186 は POSIX.1-2008 で規定されている。
187 .\"O .SH NOTES
188 .SH 注意
189 .\"O The underlying file descriptor of the directory stream can be obtained using
190 .\"O .BR dirfd (3).
191 ディレクトリストリームに対応するファイルディスクリプタは
192 .BR dirfd (3)
193 を使用して得ることができる。
194
195 .\"O The
196 .\"O .BR opendir ()
197 .\"O function sets the close-on-exec flag for the file descriptor underlying the
198 .\"O .IR "DIR *" .
199 .\"O The
200 .\"O .BR fdopendir ()
201 .\"O function leaves the setting of the close-on-exec
202 .\"O flag unchanged for the file descriptor,
203 .\"O .IR fd .
204 .BR opendir ()
205 関数は、
206 .I "DIR *"
207 の背後にあるファイルディスクリプタの close-on-exec フラグを設定する。
208 .BR fdopendir ()
209 関数は、ファイルディスクリプタの close-on-exec フラグの設定を変更しない。
210 .\"O POSIX.1-200x leaves it unspecified whether a successful call to
211 .\"O .BR fdopendir ()
212 .\"O will set the close-on-exec flag for the file descriptor,
213 .\"O .IR fd .
214 .BR fdopendir ()
215 の呼び出しが成功した際に、ファイルディスクリプタ
216 .I fd
217 の close-on-exec を設定するかどうかは、
218 POSIX.1-200x では規定されていない。
219 .\"O .SH "SEE ALSO"
220 .SH 関連項目
221 .BR open (2),
222 .BR closedir (3),
223 .BR dirfd (3),
224 .BR readdir (3),
225 .BR rewinddir (3),
226 .BR scandir (3),
227 .BR seekdir (3),
228 .BR telldir (3)