OSDN Git Service

(split) DP: release pages (catch up to 3.50).
[linuxjm/LDP_man-pages.git] / release / man3 / opendir.3
index 604d4c1..52a973c 100644 (file)
@@ -1,5 +1,6 @@
 .\" Copyright (C) 1993 David Metcalfe (david@prism.demon.co.uk)
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" References consulted:
 .\"     Linux libc source code
 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
 .\"     386BSD man pages
 .\" Modified Sat Jul 24 18:46:01 1993 by Rik Faith (faith@cs.unc.edu)
-.\" Modified 11 June 1995 by Andries Brouwer (aeb@cwi.nl).
+.\" Modified 11 June 1995 by Andries Brouwer (aeb@cwi.nl)
 .\" 2007-07-30 Ulrich Drepper <drepper@redhat.com>: document fdopendir().
+.\"*******************************************************************
 .\"
-.\" Japanese Version Copyright (c) 1997 Seiichi Yoshida
-.\"       all rights reserved.
-.\" Translated Fri Feb 14 14:53:20 JST 1997
-.\"         by Seiichi Yoshida <seiichi@muraoka.info.waseda.ac.jp>
-.\" Updated & Modified Thu Feb 17 00:37:46 JST 2005
-.\"         by Yuichi SATO <ysato444@yahoo.co.jp>
+.\" This file was generated with po4a. Translate the source file.
 .\"
-.\"WORD:    directory stream            ¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à
-.\"WORD:    entry                       ¥¨¥ó¥È¥ê
-.\"WORD:    Permission denied           ¥¢¥¯¥»¥¹¸¢¸Â¤¬¤Ê¤¤
-.\"WORD:    file descriptor             ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿
-.\"
-.TH OPENDIR 3  2008-08-06 "" "Linux Programmer's Manual"
-.SH Ì¾Á°
-opendir, fdopendir \- ¥Ç¥£¥ì¥¯¥È¥ê¤ò¥ª¡¼¥×¥ó¤¹¤ë
-.SH ½ñ¼°
+.\"*******************************************************************
+.TH OPENDIR 3 2010\-06\-20 GNU "Linux Programmer's Manual"
+.SH 名前
+opendir, fdopendir \- ディレクトリをオープンする
+.SH 書式
 .nf
-.B #include <sys/types.h>
+\fB#include <sys/types.h>\fP
 .br
-.B #include <dirent.h>
+\fB#include <dirent.h>\fP
 .sp
-.BI "DIR *opendir(const char *" name );
-.BI "DIR *fdopendir(int " fd );
+\fBDIR *opendir(const char *\fP\fIname\fP\fB);\fP
+\fBDIR *fdopendir(int \fP\fIfd\fP\fB);\fP
 .fi
-.SH ÀâÌÀ
-.BR opendir ()
-´Ø¿ô¤Ï¥Ç¥£¥ì¥¯¥È¥ê \fIname\fP ¤ËÂбþ¤¹¤ë
-¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤ò¥ª¡¼¥×¥ó¤·¡¢¤½¤Î¥¹¥È¥ê¡¼¥à¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
-¥¹¥È¥ê¡¼¥à¤Î°ÌÃ֤ϥǥ£¥ì¥¯¥È¥ê¤ÎÀèƬ¤Î¥¨¥ó¥È¥ê¤ËÀßÄꤵ¤ì¤ë¡£
+.sp
+.in -4n
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
+.in
+.sp
+\fBfdopendir\fP():
+.PD 0
+.ad l
+.RS 4
+.TP  4
+glibc 2.10 以降:
+_XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
+.TP 
+glibc 2.10 より前:
+_GNU_SOURCE
+.RE
+.ad
+.PD
+.SH 説明
+\fBopendir\fP()  関数はディレクトリ \fIname\fP に対応する ディレクトリストリームをオープンし、そのストリームへのポインタを返す。
+ストリームの位置はディレクトリの先頭のエントリに設定される。
 
-.BR fdopendir ()
-´Ø¿ô¤Ï
-.BR opendir ()
-¤ÈƱÍͤÀ¤¬¡¢¥ª¡¼¥×¥óºÑ¤ß¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿
-.I fd
-¤Ë¤è¤ê»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ¹¤ë
-¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤òÊÖ¤¹¡£
-.BR fdopendir ()
-¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤·¤¿¸å¤Ï¡¢
-.I fd
-¤Ï¼ÂÁõ¤ÎÆâÉô¤Ç»ÈÍѤµ¤ì¤ë¡£¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï
-.I fd
-¤ò¾¤Î¾ìÌ̤ǻÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£
-.SH ÊÖ¤êÃÍ
-´Ø¿ô
-.BR opendir ()
-¤È
-.BR fdopendir ()
-¤Ï¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
-¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢NULL ¤¬ÊÖ¤µ¤ì¤Æ¡¢
-.I errno
-¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
-.SH ¥¨¥é¡¼
-.TP
-.B EACCES
-¥¢¥¯¥»¥¹¸¢¸Â¤¬¤Ê¤¤¡£
-.TP
-.B EBADF
-.I fd
-¤¬Æɤ߽Ф·ÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤¿¡¢Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ï¤Ê¤¤¡£
-.TP
-.B EMFILE
-¥×¥í¥»¥¹¤¬»ÈÍÑÃæ¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Â¿¤¹¤®¤ë¡£
-.TP
-.B ENFILE
-¥·¥¹¥Æ¥à¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤¬Â¿¤¹¤®¤ë¡£
-.TP
-.B ENOENT
-¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢¤Þ¤¿¤Ï \fIname\fP ¤¬¶õʸ»úÎó¤Ç¤¢¤ë¡£
-.TP
-.B ENOMEM
-Ì¿Îá¤ò¼Â¹Ô¤¹¤ë¤Î¤Ë½¼Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£
-.TP
-.B ENOTDIR
-\fIname\fP ¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£
-.SH ¥Ð¡¼¥¸¥ç¥ó
-.BR fdopendir ()
-¤Ï glibc 2.4 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£
-.SH ½àµò
-.BR opendir ()
-¤Ï SVr4 ¤È 4.3BSD ¤Ë¸ºß¤·¡¢
-POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£
-.BR fdopendir ()
-¤Ï POSIX.1-2008 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£
-.SH Ãí°Õ
-¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤ËÂбþ¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï
-.BR dirfd (3)
-¤ò»ÈÍѤ·¤ÆÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
+\fBfdopendir\fP()  関数は \fBopendir\fP()  と同様だが、オープン済みのファイルディスクリプタ \fIfd\fP
+により参照されるディレクトリに対する ディレクトリストリームを返す。 \fBfdopendir\fP()  の呼び出しが成功した後は、 \fIfd\fP
+は実装の内部で使用される。アプリケーションは \fIfd\fP を他の場面で使用すべきではない。
+.SH 返り値
+関数 \fBopendir\fP()  と \fBfdopendir\fP()  はディレクトリストリームへのポインタを返す。 エラーの場合は、NULL
+が返されて、 \fIerrno\fP が適切に設定される。
+.SH エラー
+.TP 
+\fBEACCES\fP
+アクセス権限がない。
+.TP 
+\fBEBADF\fP
+\fIfd\fP が読み出し用にオープンされた、有効なファイルディスクリプタではない。
+.TP 
+\fBEMFILE\fP
+プロセスが使用中のファイルディスクリプタが多すぎる。
+.TP 
+\fBENFILE\fP
+システムでオープンされているファイルが多すぎる。
+.TP 
+\fBENOENT\fP
+ディレクトリが存在しないか、または \fIname\fP が空文字列である。
+.TP 
+\fBENOMEM\fP
+操作を完了するのに十分なメモリがない。
+.TP 
+\fBENOTDIR\fP
+\fIname\fP はディレクトリではない。
+.SH バージョン
+\fBfdopendir\fP()  は glibc 2.4 以降で利用可能である。
+.SH 準拠
+\fBopendir\fP()  は SVr4 と 4.3BSD に存在し、 POSIX.1\-2001 で規定されている。 \fBfdopendir\fP()  は
+POSIX.1\-2008 で規定されている。
+.SH 注意
+ディレクトリストリームに対応するファイルディスクリプタは \fBdirfd\fP(3)  を使用して得ることができる。
 
-.BR opendir ()
-´Ø¿ô¤Ï¡¢
-.I "DIR *"
-¤ÎÇظå¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î close-on-exec ¥Õ¥é¥°¤òÀßÄꤹ¤ë¡£
-.BR fdopendir ()
-´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î close-on-exec ¥Õ¥é¥°¤ÎÀßÄê¤òÊѹ¹¤·¤Ê¤¤¡£
-.BR fdopendir ()
-¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤·¤¿ºÝ¤Ë¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿
-.I fd
-¤Î close-on-exec ¤òÀßÄꤹ¤ë¤«¤É¤¦¤«¤Ï¡¢
-POSIX.1-200x ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£
-.SH ´ØÏ¢¹àÌÜ
-.BR open (2),
-.BR closedir (3),
-.BR dirfd (3),
-.BR readdir (3),
-.BR rewinddir (3),
-.BR scandir (3),
-.BR seekdir (3),
-.BR telldir (3)
+\fBopendir\fP()  関数は、 \fIDIR *\fP の背後にあるファイルディスクリプタの close\-on\-exec フラグを設定する。
+\fBfdopendir\fP()  関数は、ファイルディスクリプタの close\-on\-exec フラグの設定を変更しない。 \fBfdopendir\fP()
+の呼び出しが成功した際に、ファイルディスクリプタ \fIfd\fP の close\-on\-exec を設定するかどうかは、 POSIX.1\-200x
+では規定されていない。
+.SH 関連項目
+\fBopen\fP(2), \fBclosedir\fP(3), \fBdirfd\fP(3), \fBreaddir\fP(3), \fBrewinddir\fP(3),
+\fBscandir\fP(3), \fBseekdir\fP(3), \fBtelldir\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。