OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[linuxjm/LDP_man-pages.git] / release / 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 .\"
32 .\" This file was generated with po4a. Translate the source file.
33 .\"
34 .\"*******************************************************************
35 .TH OPENDIR 3 2010\-06\-20 GNU "Linux Programmer's Manual"
36 .SH 名前
37 opendir, fdopendir \- ディレクトリをオープンする
38 .SH 書式
39 .nf
40 \fB#include <sys/types.h>\fP
41 .br
42 \fB#include <dirent.h>\fP
43 .sp
44 \fBDIR *opendir(const char *\fP\fIname\fP\fB);\fP
45 \fBDIR *fdopendir(int \fP\fIfd\fP\fB);\fP
46 .fi
47 .sp
48 .in -4n
49 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
50 .in
51 .sp
52 \fBfdopendir\fP():
53 .PD 0
54 .ad l
55 .RS 4
56 .TP  4
57 glibc 2.10 以降:
58 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
59 .TP 
60 glibc 2.10 より前:
61 _GNU_SOURCE
62 .RE
63 .ad
64 .PD
65 .SH 説明
66 \fBopendir\fP()  関数はディレクトリ \fIname\fP に対応する ディレクトリストリームをオープンし、そのストリームへのポインタを返す。
67 ストリームの位置はディレクトリの先頭のエントリに設定される。
68
69 \fBfdopendir\fP()  関数は \fBopendir\fP()  と同様だが、オープン済みのファイルディスクリプタ \fIfd\fP
70 により参照されるディレクトリに対する ディレクトリストリームを返す。 \fBfdopendir\fP()  の呼び出しが成功した後は、 \fIfd\fP
71 は実装の内部で使用される。アプリケーションは \fIfd\fP を他の場面で使用すべきではない。
72 .SH 返り値
73 関数 \fBopendir\fP()  と \fBfdopendir\fP()  はディレクトリストリームへのポインタを返す。 エラーの場合は、NULL
74 が返されて、 \fIerrno\fP が適切に設定される。
75 .SH エラー
76 .TP 
77 \fBEACCES\fP
78 アクセス権限がない。
79 .TP 
80 \fBEBADF\fP
81 \fIfd\fP が読み出し用にオープンされた、有効なファイルディスクリプタではない。
82 .TP 
83 \fBEMFILE\fP
84 プロセスが使用中のファイルディスクリプタが多すぎる。
85 .TP 
86 \fBENFILE\fP
87 システムでオープンされているファイルが多すぎる。
88 .TP 
89 \fBENOENT\fP
90 ディレクトリが存在しないか、または \fIname\fP が空文字列である。
91 .TP 
92 \fBENOMEM\fP
93 操作を完了するのに十分なメモリがない。
94 .TP 
95 \fBENOTDIR\fP
96 \fIname\fP はディレクトリではない。
97 .SH バージョン
98 \fBfdopendir\fP()  は glibc 2.4 以降で利用可能である。
99 .SH 準拠
100 \fBopendir\fP()  は SVr4 と 4.3BSD に存在し、 POSIX.1\-2001 で規定されている。 \fBfdopendir\fP()  は
101 POSIX.1\-2008 で規定されている。
102 .SH 注意
103 ディレクトリストリームに対応するファイルディスクリプタは \fBdirfd\fP(3)  を使用して得ることができる。
104
105 \fBopendir\fP()  関数は、 \fIDIR *\fP の背後にあるファイルディスクリプタの close\-on\-exec フラグを設定する。
106 \fBfdopendir\fP()  関数は、ファイルディスクリプタの close\-on\-exec フラグの設定を変更しない。 \fBfdopendir\fP()
107 の呼び出しが成功した際に、ファイルディスクリプタ \fIfd\fP の close\-on\-exec を設定するかどうかは、 POSIX.1\-200x
108 では規定されていない。
109 .SH 関連項目
110 \fBopen\fP(2), \fBclosedir\fP(3), \fBdirfd\fP(3), \fBreaddir\fP(3), \fBrewinddir\fP(3),
111 \fBscandir\fP(3), \fBseekdir\fP(3), \fBtelldir\fP(3)