OSDN Git Service

(split) LDP: Update release from ja.po of LDP v3.51
[linuxjm/LDP_man-pages.git] / release / man3 / readdir.3
index c6ceaaa..61b2fba 100644 (file)
@@ -38,7 +38,7 @@
 .\" This file was generated with po4a. Translate the source file.
 .\"
 .\"*******************************************************************
-.TH READDIR 3 2012\-07\-07 "" "Linux Programmer's Manual"
+.TH READDIR 3 2013\-03\-24 "" "Linux Programmer's Manual"
 .SH 名前
 readdir, readdir_r \- ディレクトリを読み込む
 .SH 書式
@@ -71,7 +71,7 @@ Linux では \fIdirent\fP 構造体は以下のように定義されている。
 .nf
 struct dirent {
     ino_t          d_ino;       /* inode 番号 */
-    off_t          d_off;       /* 次の dirent へのオフセット */
+    off_t          d_off;       /* オフセットではない; 注意を参照 */
     unsigned short d_reclen;    /* このレコードの長さ */
     unsigned char  d_type;      /* ファイル種別。全ファイルシステム */
                                    でサポートされているわけではない */
@@ -112,6 +112,14 @@ SVr4, 4.3BSD, POSIX.1\-2001.
 \fB_DIRENT_HAVE_D_RECLEN\fP, \fB_DIRENT_HAVE_D_OFF\fP, \fB_DIRENT_HAVE_D_TYPE\fP
 が定義されているかをテストすればよい。
 
+.\" https://lwn.net/Articles/544298/
+The value returned in \fId_off\fP is the same as would be returned by calling
+\fBtelldir\fP(3)  at the current position in the directory stream.  Be aware
+that despite its type and name, the \fId_off\fP field is seldom any kind of
+directory offset on modern file systems.  Applications should treat this
+field as an opaque value, making no assumptions about its contents; see also
+\fBtelldir\fP(3).
+
 \fId_type\fP フィールドは、Linux 以外では、 主に BSD 系のシステムにだけ存在する。 このフィールドを使うと、
 その後の動作がファイルの種別により決まる場合に、 \fBlstat\fP(2)  を呼び出すコストを避けることができる。 機能検査マクロ
 \fB_BSD_SOURCE\fP が定義された場合、glibc は \fId_type\fP で返される値として以下のマクロ定数を定義する。
@@ -157,8 +165,8 @@ POSIX.1 では \fId_name\fP フィールドのサイズは規定されておら
 .nf
 
 name_max = pathconf(dirpath, _PC_NAME_MAX);
-if (name_max == \-1)         /* Limit not defined, or error */
-    name_max = 255;         /* Take a guess */
+if (name_max == \-1)         /* 上限が定義されていない、またはエラー */
+    name_max = 255;         /* 適当な値を入れる */
 len = offsetof(struct dirent, d_name) + name_max + 1;
 entryp = malloc(len);
 
@@ -170,6 +178,6 @@ entryp = malloc(len);
 \fBoffsetof\fP(3), \fBopendir\fP(3), \fBrewinddir\fP(3), \fBscandir\fP(3),
 \fBseekdir\fP(3), \fBtelldir\fP(3)
 .SH この文書について
-この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.51 の一部
 である。プロジェクトの説明とバグ報告に関する情報は
 http://www.kernel.org/doc/man\-pages/ に書かれている。