OSDN Git Service

(split) LDP: Update the version to 3.53 in PO files
[linuxjm/LDP_man-pages.git] / draft / man2 / readdir.2
1 .\" Copyright (C) 1995 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 .\" Written 11 June 1995 by Andries Brouwer <aeb@cwi.nl>
26 .\" Modified 22 July 1995 by Michael Chastain <mec@duracef.shout.net>:
27 .\"   In 1.3.X, returns only one entry each time; return value is different.
28 .\" Modified 2004-12-01, mtk, fixed headers listed in SYNOPSIS
29 .\"
30 .\"*******************************************************************
31 .\"
32 .\" This file was generated with po4a. Translate the source file.
33 .\"
34 .\"*******************************************************************
35 .TH READDIR 2 2013\-06\-21 Linux "Linux Programmer's Manual"
36 .SH 名前
37 readdir \- ディレクトリ・エントリを読み込む
38 .SH 書式
39 .nf
40 .sp
41 \fBint readdir(unsigned int \fP\fIfd\fP\fB, struct old_linux_dirent *\fP\fIdirp\fP\fB,\fP
42 \fB            unsigned int \fP\fIcount\fP\fB);\fP
43 .fi
44
45 \fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。
46 .SH 説明
47 これはあなたの興味をもっている関数ではない。 POSIX 準拠の C ライブラリ・インターフェースについては \fBreaddir\fP(3)  を見ること。
48 このページは裸のカーネルのシステムコール・インターフェースについて 記述しているが、このインターフェースは \fBgetdents\fP(2)
49 によって取って代わられた。
50 .PP
51 \fBreaddir\fP()  は、ファイルディスクリプタ \fIfd\fP が参照しているディレクトリから \fIold_linux_dirent\fP
52 構造体を読み込み、 \fIdirp\fP で指されたバッファに格納する。 \fIcount\fP 引き数は(ほとんどの \fIold_linux_dirent\fP
53 構造体の読み込みにおいて)無視される
54 .PP
55 \fIold_linux_dirent\fP 構造体は以下のように宣言される:
56 .PP
57 .in +4n
58 .nf
59 struct old_linux_dirent {
60     long  d_ino;              /* inode number */
61     off_t d_off;              /* offset to this \fIold_linux_dirent\fP */
62     unsigned short d_reclen;  /* length of this \fId_name\fP */
63     char  d_name[NAME_MAX+1]; /* filename (null\-terminated) */
64 }
65 .fi
66 .in
67 .PP
68 \fId_ino\fP は inode 番号である。 \fId_off\fP はディレクトリの最初からこの \fIold_linux_dirent\fP まで距離である。
69 \fId_reclen\fP は \fId_name\fP の大きさで、終端のヌルバイト (\(aq\e0\(aq) を含まない。 \fId_name\fP
70 はヌルバイトで終わるファイル名である。
71 .SH 返り値
72 成功した場合は、1 が返される。 ディレクトリの最後では 0 が返される。 エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。
73 .SH エラー
74 .TP 
75 \fBEBADF\fP
76 ファイルディスクリプタ \fIfd\fP が不正である。
77 .TP 
78 \fBEFAULT\fP
79 引き数が呼び出したプロセスのアドレス空間外を指している。
80 .TP 
81 \fBEINVAL\fP
82 結果用のバッファーが小さすぎる。
83 .TP 
84 \fBENOENT\fP
85 そのようなディレクトリは存在しない。
86 .TP 
87 \fBENOTDIR\fP
88 ファイルディスクリプタがディレクトリを参照していない。
89 .SH 準拠
90 このシステム・コールは Linux 特有である。
91 .SH 注意
92 glibc はこのシステムコールに対するラッパー関数を提供していない。 \fBsyscall\fP(2)  を使って呼び出すこと。
93 \fIold_linux_dirent\fP 構造体を自分自身で定義する必要がある。しかし、たいていはこのシステムコールではなく \fBreaddir\fP(3)
94 を使うべき場面のことが多い。
95
96 このシステムコールは x86\-64 では存在しない。
97 .SH 関連項目
98 \fBgetdents\fP(2), \fBreaddir\fP(3)
99 .SH この文書について
100 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
101 である。プロジェクトの説明とバグ報告に関する情報は
102 http://www.kernel.org/doc/man\-pages/ に書かれている。