OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man2 / getdents.2
index 59d71ea..3d97679 100644 (file)
@@ -69,12 +69,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)
     */
 
 }
@@ -134,7 +134,7 @@ attempting to access this field always provides the value 0
 Currently,
 .\" kernel 2.6.27
 .\" The same sentence is in readdir.2
-only some file systems (among them: Btrfs, ext2, ext3, and ext4)
+only some filesystems (among them: Btrfs, ext2, ext3, and ext4)
 have full support for returning the file type in
 .IR d_type .
 All applications must properly handle a return of
@@ -180,7 +180,7 @@ This call supersedes
 
 The original Linux
 .BR getdents ()
-system call did not handle large file systems and large file offsets.
+system call did not handle large filesystems and large file offsets.
 Consequently, Linux 2.4 added
 .BR getdents64 (),
 with wider types for the
@@ -191,8 +191,8 @@ fields employed in the
 .IR linux_dirent
 structure.
 .SH EXAMPLE
-.\" FIXME: This program uses the older getdents(0 system call
-.\" and the structure with smaller field widths.
+.\" FIXME The example program needs to be revised, since it uses the older
+.\" getdents() system call and the structure with smaller field widths.
 The program below demonstrates the use of
 .BR getdents ().
 The following output shows an example of what we see when running this
@@ -202,7 +202,7 @@ program on an ext2 directory:
 .nf
 .RB "$" " ./a.out /testfs/"
 --------------- nread=120 ---------------
-i-node#  file type  d_reclen  d_off   d_name
+inode#    file type  d_reclen  d_off   d_name
        2  directory    16         12  .
        2  directory    16         24  ..
       11  directory    24         44  lost+found
@@ -258,7 +258,7 @@ main(int argc, char *argv[])
             break;
 
         printf("\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- nread=%d \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\\n", nread);
-        printf("i\-node#  file type  d_reclen  d_off   d_name\\n");
+        printf("inode#    file type  d_reclen  d_off   d_name\\n");
         for (bpos = 0; bpos < nread;) {
             d = (struct linux_dirent *) (buf + bpos);
             printf("%8ld  ", d\->d_ino);
@@ -282,3 +282,12 @@ main(int argc, char *argv[])
 .SH SEE ALSO
 .BR readdir (2),
 .BR readdir (3)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.