OSDN Git Service

(split) Convert release and draft pages to UTF-8.
[linuxjm/LDP_man-pages.git] / draft / man3 / dirfd.3
1 .\" Copyright (C) 2002 Andries Brouwer (aeb@cwi.nl)
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 .\"
24 .\" Japanese Version Copyright (c) 2002-2003 Yuichi SATO
25 .\"         all rights reserved.
26 .\" Translated Mon May  6 21:32:36 JST 2002
27 .\"         by Yuichi SATO <ysato@h4.dion.ne.jp>
28 .\" Updated & Modified Sun Sep  7 01:23:08 JST 2003
29 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
30 .\"
31 .TH DIRFD 3 2010-09-26 "Linux" "Linux Programmer's Manual"
32 .\"O .SH NAME
33 .SH 名前
34 .\"O dirfd \- get directory stream file descriptor
35 dirfd \- ディレクトリ・ストリームのファイル・ディスクリプタを取得する
36 .\"O .SH SYNOPSIS
37 .SH 書式
38 .B #include <sys/types.h>
39 .br
40 .B #include <dirent.h>
41 .sp
42 .BI "int dirfd(DIR *" dirp );
43 .sp
44 .in -4n
45 .\"O Feature Test Macro Requirements for glibc (see
46 .\"O .BR feature_test_macros (7)):
47 glibc 向けの機能検査マクロの要件
48 .RB ( feature_test_macros (7)
49 参照):
50 .in
51 .sp
52 .BR dirfd ():
53 .br
54 .RS 4
55 .PD 0
56 .ad l
57 _BSD_SOURCE || _SVID_SOURCE
58 .br
59 .\"O || /* Since glibc 2.10: */
60 || /* glibc 2.10 以降: */
61 .RS 4
62 (_POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700)
63 .RE
64 .PD
65 .RE
66 .ad
67 .\"O .SH DESCRIPTION
68 .SH 説明
69 .\"O The function
70 .\"O .BR dirfd ()
71 .\"O returns the file descriptor associated with the directory stream
72 .\"O .IR dirp .
73 関数
74 .BR dirfd ()
75 はディレクトリ・ストリーム
76 .I dirp
77 に関連づけられたファイル・ディスクリプタを返す。
78 .LP
79 .\"O This descriptor is the one used internally by the directory stream.
80 このディスクリプタはディレクトリ・ストリームが内部で使用するものである。
81 .\"O As a result, it is only useful for functions which do not depend on
82 .\"O or alter the file position, such as
83 .\"O .BR fstat (2)
84 .\"O and
85 .\"O .BR fchdir (2).
86 よって、ファイルの位置に依存せず、かつその位置を変更しない関数
87 .BR fstat (2)
88
89 .BR fchdir (2)
90 などでしか役に立たない。
91 .\"O It will be automatically closed when
92 .\"O .BR closedir (3)
93 .\"O is called.
94 このディスクリプタは
95 .BR closedir (3)
96 が呼ばれたときに自動的にクローズされる。
97 .\"O .SH RETURN VALUE
98 .SH 返り値
99 .\"O On success, a nonnegative file descriptor is returned.
100 .\"O On error, \-1 is returned.
101 成功すると、負でない値のファイルディスクリプタが返される。
102 エラーの場合は \-1 が返される。
103 .\"O .SH ERRORS
104 .SH エラー
105 .\"O POSIX.1-2008 specifies two errors,
106 .\"O neither of which is returned by the current
107 .\"O .\" glibc 2.8
108 .\"O implementation.
109 POSIX.1-2008 では 2 つのエラーが規定されている。
110 現在の実装ではどちらのエラーも返されない。
111 .\" glibc 2.8
112 .TP
113 .B EINVAL
114 .\"O .I dirp
115 .\"O does not refer to a valid directory stream.
116 .I dirp
117 が有効なディレクトリ・ストリームを参照していない。
118 .TP
119 .B ENOTSUP
120 .\"O The implementation does not support the association of a file
121 .\"O descriptor with a directory.
122 この実装では、ファイルディスクリプタのディレクトリとの関連付けが
123 サポートされていない。
124 .\"O .SH "CONFORMING TO"
125 .SH 準拠
126 POSIX.1-2008.
127 .\"O This function was a BSD extension, present in 4.3BSD-Reno, not in 4.2BSD.
128 .\"O .\" It is present in libc5 (since 5.1.2) and in glibc2.
129 この関数は BSD 拡張であった。
130 4.3BSD-Reno には存在するが、4.2BSD には存在しない。
131 .\" libc5 (5.1.2 以降) と glibc2 に存在する。
132 .\"O .SH NOTES
133 .SH 注意
134 .\"O The prototype for
135 .\"O .BR dirfd ()
136 .\"O is only available if
137 .\"O .B _BSD_SOURCE
138 .\"O or
139 .\"O .B _SVID_SOURCE
140 .\"O is defined.
141 .BR dirfd ()
142 のプロトタイプが使用可能なのは、
143 .B _BSD_SOURCE
144 または
145 .B _SVID_SOURCE
146 が定義されたときのみである。
147 .\"O .SH "SEE ALSO"
148 .SH 関連項目
149 .BR open (2),
150 .BR closedir (3),
151 .BR opendir (3),
152 .BR readdir (3),
153 .BR rewinddir (3),
154 .BR scandir (3),
155 .BR seekdir (3),
156 .BR telldir (3)