1 .\" Copyright (C) 2002 Andries Brouwer (aeb@cwi.nl)
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.
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.
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
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
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>
31 .TH DIRFD 3 2010-09-26 "Linux" "Linux Programmer's Manual"
34 .\"O dirfd \- get directory stream file descriptor
35 dirfd \- ディレクトリ・ストリームのファイル・ディスクリプタを取得する
38 .B #include <sys/types.h>
40 .B #include <dirent.h>
42 .BI "int dirfd(DIR *" dirp );
45 .\"O Feature Test Macro Requirements for glibc (see
46 .\"O .BR feature_test_macros (7)):
48 .RB ( feature_test_macros (7)
57 _BSD_SOURCE || _SVID_SOURCE
59 .\"O || /* Since glibc 2.10: */
60 || /* glibc 2.10 以降: */
62 (_POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700)
71 .\"O returns the file descriptor associated with the directory stream
77 に関連づけられたファイル・ディスクリプタを返す。
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
86 よって、ファイルの位置に依存せず、かつその位置を変更しない関数
91 .\"O It will be automatically closed when
99 .\"O On success, a nonnegative file descriptor is returned.
100 .\"O On error, \-1 is returned.
101 成功すると、負でない値のファイルディスクリプタが返される。
105 .\"O POSIX.1-2008 specifies two errors,
106 .\"O neither of which is returned by the current
109 POSIX.1-2008 では 2 つのエラーが規定されている。
110 現在の実装ではどちらのエラーも返されない。
115 .\"O does not refer to a valid directory stream.
117 が有効なディレクトリ・ストリームを参照していない。
120 .\"O The implementation does not support the association of a file
121 .\"O descriptor with a directory.
122 この実装では、ファイルディスクリプタのディレクトリとの関連付けが
124 .\"O .SH "CONFORMING TO"
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.
130 4.3BSD-Reno には存在するが、4.2BSD には存在しない。
131 .\" libc5 (5.1.2 以降) と glibc2 に存在する。
134 .\"O The prototype for
136 .\"O is only available if