OSDN Git Service

Update releases for LDP 3.68
[linuxjm/LDP_man-pages.git] / release / man2 / getdents.2
index 4aa5fca..92b7646 100644 (file)
@@ -1,5 +1,6 @@
 .\" Copyright (C) 1995 Andries Brouwer (aeb@cwi.nl)
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" Written 11 June 1995 by Andries Brouwer <aeb@cwi.nl>
 .\" Modified 22 July 1995 by Michael Chastain <mec@duracef.shout.net>:
 .\"   Derived from 'readdir.2'.
 .\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond <esr@thyrsus.com>
+.\"
 .\"*******************************************************************
 .\"
 .\" This file was generated with po4a. Translate the source file.
 .\"
 .\"*******************************************************************
-.TH GETDENTS 2 2010\-11\-21 Linux "Linux Programmer's Manual"
+.\"
+.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
+.\"         all rights reserved.
+.\" Translated Sat Feb 22 20:15:56 JST 1997
+.\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
+.\" Updated Sun Oct 12 JST 2003 by Kentaro Shirakata <argrath@ub32.org>
+.\" Updated Wed Jul 30 JST 2008 by Kentaro Shirakata <argrath@ub32.org>
+.\" Updated 2009-02-12 by Kentaro Shirakata <argrath@ub32.org>
+.\" Updated 2012-04-30, Akihiro MOTOKI <amotoki@gmail.com>
+.\" Updated 2013-03-26, Akihiro MOTOKI <amotoki@gmail.com>
+.\"
+.TH GETDENTS 2 2012\-08\-03 Linux "Linux Programmer's Manual"
 .SH 名前
 getdents \- ディレクトリ・エントリを取得する
 .SH 書式
@@ -37,6 +51,8 @@ getdents \- ディレクトリ・エントリを取得する
 \fBint getdents(unsigned int \fP\fIfd\fP\fB, struct linux_dirent *\fP\fIdirp\fP\fB,\fP
 \fB             unsigned int \fP\fIcount\fP\fB);\fP
 .fi
+
+\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。
 .SH 説明
 これはあなたの関心を引くような関数ではない。 POSIX 準拠の C ライブラリインターフェースについては \fBreaddir\fP(3)  を見ること。
 このページは、カーネルシステムコールの生のインターフェースについて 記載したものである。
@@ -54,12 +70,12 @@ struct linux_dirent {
     unsigned long  d_off;     /* Offset to next \fIlinux_dirent\fP */
     unsigned short d_reclen;  /* Length of this \fIlinux_dirent\fP */
     char           d_name[];  /* Filename (null\-terminated) */
-                        /* length is actually (d_reclen \- 2 \-
-                           offsetof(struct linux_dirent, d_name) */
+                      /* length is actually (d_reclen \- 2 \-
+                         offsetof(struct linux_dirent, d_name)) */
     /*
     char           pad;       // Zero padding byte
-    char           d_type;    // File type (only since Linux 2.6.4;
-                              // offset is (d_reclen \- 1))
+    char           d_type;    // File type (only since Linux
+                              // 2.6.4); offset is (d_reclen \- 1)
     */
 
 }
@@ -67,8 +83,7 @@ struct linux_dirent {
 .in
 .PP
 \fId_ino\fP は inode 番号である。 \fId_off\fP はディレクトリの先頭から次の \fIlinux_dirent\fP の先頭までの距離である。
-\fId_reclen\fP はこの \fIlinux_dirent\fP 全体のサイズである。 \fId_name\fP
-はヌル(null)文字で終わるファイル名である。
+\fId_reclen\fP はこの \fIlinux_dirent\fP 全体のサイズである。 \fId_name\fP はヌル文字で終わるファイル名である。
 
 \fId_type\fP は、構造体の最後のバイトであり、ファイルタイプを示す。 \fId_type\fP は以下の値の一つを取る
 (\fI<dirent.h>\fP で定義されている)。
@@ -130,7 +145,8 @@ UNIX ドメインソケットである。
 SVr4.
 .SH 注意
 glibc はこのシステムコールに対するラッパー関数を提供していないので、 \fBsyscall\fP(2)  を使って呼び出すこと。
-\fIlinux_dirent\fP 構造体は自分で定義する必要がある。
+\fIlinux_dirent\fP 構造体は自分で定義する必要がある。しかし、たいていはこのシステムコールではなく \fBreaddir\fP(3)
+を使うべき場面のことが多い。
 
 このシステムコールは \fBreaddir\fP(2)  を置き換えるものである。
 
@@ -140,7 +156,7 @@ glibc はこのシステムコールに対するラッパー関数を提供し
 \fBgetdents64\fP() では、\fIlinux_dirent\fP 構造体のフィールド \fId_ino\fP と
 \fId_off\fP でビット幅の大きなデータ型が使われている。
 .SH 例
-.\" FIXME: This program uses the older getdents(0 system call
+.\" FIXME: This program uses the older getdents() system call
 .\" and the structure with smaller field widths.
 下記のプログラムは \fBgetdents\fP()  の使用例を示したものである。 以下は、このプログラムを ext2 ディレクトリで実行した際に得られる
 出力の例である。
@@ -218,7 +234,7 @@ main(int argc, char *argv[])
                              (d_type == DT_BLK) ?  "block dev" :
                              (d_type == DT_CHR) ?  "char dev" : "???");
             printf("%4d %10lld  %s\en", d\->d_reclen,
-                    (long long) d\->d_off, (char *) d\->d_name);
+                    (long long) d\->d_off, d\->d_name);
             bpos += d\->d_reclen;
         }
     }
@@ -229,6 +245,6 @@ main(int argc, char *argv[])
 .SH 関連項目
 \fBreaddir\fP(2), \fBreaddir\fP(3)
 .SH この文書について
-この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.40 の一部
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.68 の一部
 である。プロジェクトの説明とバグ報告に関する情報は
 http://www.kernel.org/doc/man\-pages/ に書かれている。