OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[linuxjm/LDP_man-pages.git] / release / 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 .\"
25 .\" This file was generated with po4a. Translate the source file.
26 .\"
27 .\"*******************************************************************
28 .TH DIRFD 3 2010\-09\-26 Linux "Linux Programmer's Manual"
29 .SH 名前
30 dirfd \- ディレクトリストリームのファイルディスクリプタを取得する
31 .SH 書式
32 \fB#include <sys/types.h>\fP
33 .br
34 \fB#include <dirent.h>\fP
35 .sp
36 \fBint dirfd(DIR *\fP\fIdirp\fP\fB);\fP
37 .sp
38 .in -4n
39 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
40 .in
41 .sp
42 \fBdirfd\fP():
43 .br
44 .RS 4
45 .PD 0
46 .ad l
47 _BSD_SOURCE || _SVID_SOURCE
48 .br
49 || /* glibc 2.10 以降: */
50 .RS 4
51 (_POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700)
52 .RE
53 .PD
54 .RE
55 .ad
56 .SH 説明
57 関数 \fBdirfd\fP()  はディレクトリストリーム \fIdirp\fP に関連づけられたファイルディスクリプタを返す。
58 .LP
59 このディスクリプタはディレクトリストリームが内部で使用するものである。 よって、ファイルの位置に依存せず、かつその位置を変更しない関数
60 \fBfstat\fP(2)  や \fBfchdir\fP(2)  などでしか役に立たない。 このディスクリプタは \fBclosedir\fP(3)
61 が呼ばれたときに自動的にクローズされる。
62 .SH 返り値
63 成功すると、負でない値のファイルディスクリプタが返される。 エラーの場合は \-1 が返される。
64 .SH エラー
65 .\" glibc 2.8
66 POSIX.1\-2008 では 2 つのエラーが規定されている。 現在の実装ではどちらのエラーも返されない。
67 .TP 
68 \fBEINVAL\fP
69 \fIdirp\fP が有効なディレクトリストリームを参照していない。
70 .TP 
71 \fBENOTSUP\fP
72 この実装では、ファイルディスクリプタのディレクトリとの関連付けが サポートされていない。
73 .SH 準拠
74 .\" It is present in libc5 (since 5.1.2) and in glibc2.
75 POSIX.1\-2008.  この関数は BSD 拡張であった。 4.3BSD\-Reno には存在するが、4.2BSD には存在しない。
76 .SH 注意
77 \fBdirfd\fP()  のプロトタイプが使用可能なのは、 \fB_BSD_SOURCE\fP または \fB_SVID_SOURCE\fP
78 が定義されたときのみである。
79 .SH 関連項目
80 \fBopen\fP(2), \fBclosedir\fP(3), \fBopendir\fP(3), \fBreaddir\fP(3), \fBrewinddir\fP(3),
81 \fBscandir\fP(3), \fBseekdir\fP(3), \fBtelldir\fP(3)