mirror of https://github.com/mkerrisk/man-pages
getdents.2: comment out linux_dirent fields with varying location
The location of the fields fater d_name varies according to the size of d_name. We can't properly declare them in C; therefore, put those fields inside a comment. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
5df2ee037d
commit
5ff3825e41
|
@ -50,7 +50,7 @@ into the buffer pointed to by
|
|||
.IR dirp .
|
||||
The argument
|
||||
.I count
|
||||
is the size of the memory area.
|
||||
is specifies the size of that buffer.
|
||||
.PP
|
||||
The
|
||||
.I linux_dirent
|
||||
|
@ -62,12 +62,14 @@ struct linux_dirent {
|
|||
unsigned long d_ino; /* Inode number */
|
||||
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) */
|
||||
char d_name[]; /* Filename (null-terminated) */
|
||||
/* 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 pad; // Zero padding byte */
|
||||
char d_type; // File type (only since Linux 2.6.4;
|
||||
// offset is (d_reclen \- 1))
|
||||
*/
|
||||
|
||||
}
|
||||
.fi
|
||||
|
|
Loading…
Reference in New Issue