OSDN Git Service

Update README
[linuxjm/LDP_man-pages.git] / release / man3 / dirfd.3
1 .\" Copyright (C) 2002 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\"*******************************************************************
26 .\"
27 .\" This file was generated with po4a. Translate the source file.
28 .\"
29 .\"*******************************************************************
30 .\"
31 .\" Japanese Version Copyright (c) 2002-2003 Yuichi SATO
32 .\"         all rights reserved.
33 .\" Translated Mon May  6 21:32:36 JST 2002
34 .\"         by Yuichi SATO <ysato@h4.dion.ne.jp>
35 .\" Updated & Modified Sun Sep  7 01:23:08 JST 2003
36 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
37 .\"
38 .TH DIRFD 3 2013\-07\-05 Linux "Linux Programmer's Manual"
39 .SH 名前
40 dirfd \- ディレクトリストリームのファイルディスクリプターを取得する
41 .SH 書式
42 \fB#include <sys/types.h>\fP
43 .br
44 \fB#include <dirent.h>\fP
45 .sp
46 \fBint dirfd(DIR *\fP\fIdirp\fP\fB);\fP
47 .sp
48 .in -4n
49 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
50 .in
51 .sp
52 \fBdirfd\fP():
53 .br
54 .RS 4
55 .PD 0
56 .ad l
57 _BSD_SOURCE || _SVID_SOURCE
58 .br
59 || /* glibc 2.10 以降: */
60 .RS 4
61 (_POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700)
62 .RE
63 .PD
64 .RE
65 .ad
66 .SH 説明
67 関数 \fBdirfd\fP()  はディレクトリストリーム \fIdirp\fP に関連づけられたファイルディスクリプターを返す。
68 .LP
69 このディスクリプターはディレクトリストリームが内部で使用するものである。 よって、ファイルの位置に依存せず、かつその位置を変更しない関数
70 \fBfstat\fP(2)  や \fBfchdir\fP(2)  などでしか役に立たない。 このディスクリプターは \fBclosedir\fP(3)
71 が呼ばれたときに自動的にクローズされる。
72 .SH 返り値
73 成功すると、負でない値のファイルディスクリプターが返される。 エラーの場合は \-1 が返され、 \fIerrno\fP にエラーの原因を示す値が設定される。
74 .SH エラー
75 .\" glibc 2.8
76 POSIX.1\-2008 では 2 つのエラーが規定されている。 現在の実装ではどちらのエラーも返されない。
77 .TP 
78 \fBEINVAL\fP
79 \fIdirp\fP が有効なディレクトリストリームを参照していない。
80 .TP 
81 \fBENOTSUP\fP
82 この実装では、ファイルディスクリプターのディレクトリとの関連付けが サポートされていない。
83 .SH 属性
84 .SS "マルチスレッディング (pthreads(7) 参照)"
85 \fBdirfd\fP() 関数はスレッドセーフである。
86 .SH 準拠
87 .\" It is present in libc5 (since 5.1.2) and in glibc2.
88 POSIX.1\-2008.  この関数は BSD 拡張であった。 4.3BSD\-Reno には存在するが、4.2BSD には存在しない。
89 .SH 注意
90 \fBdirfd\fP()  のプロトタイプが使用可能なのは、 \fB_BSD_SOURCE\fP または \fB_SVID_SOURCE\fP
91 が定義されたときのみである。
92 .SH 関連項目
93 \fBopen\fP(2), \fBclosedir\fP(3), \fBopendir\fP(3), \fBreaddir\fP(3), \fBrewinddir\fP(3),
94 \fBscandir\fP(3), \fBseekdir\fP(3), \fBtelldir\fP(3)
95 .SH この文書について
96 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部
97 である。プロジェクトの説明とバグ報告に関する情報は
98 http://www.kernel.org/doc/man\-pages/ に書かれている。