--- src/lib/libc/sys/getdirentries.2 2006/05/26 19:39:37 1.3 +++ src/lib/libc/sys/getdirentries.2 2006/07/31 19:29:41 1.4 @@ -33,7 +33,7 @@ .\" $FreeBSD: src/lib/libc/sys/getdirentries.2,v 1.12.2.6 2001/12/14 18:34:00 ru Exp $ .\" $DragonFly$ .\" -.Dd May 3, 1995 +.Dd July 31, 2006 .Dt GETDIRENTRIES 2 .Os .Sh NAME @@ -49,6 +49,10 @@ .Fn getdirentries "int fd" "char *buf" "int nbytes" "long *basep" .Ft int .Fn getdents "int fd" "char *buf" "int nbytes" +.Ft size_t +.Fn _DIRENT_DIRSIZ "struct dirent *dp" +.Ft struct dirent * +.Fn _DIRENT_NEXT "struct dirent *dp" .Sh DESCRIPTION The .Fn getdirentries @@ -77,7 +81,6 @@ The data in the buffer is a series of structures each containing the following entries: .Bd -literal -offset indent u_int32_t d_fileno; -u_int16_t d_reclen; u_int8_t d_type; u_int8_t d_namlen; char d_name[MAXNAMELEN + 1]; /* see below */ @@ -92,9 +95,6 @@ Files that are linked by hard links (see have the same .Fa d_fileno . The -.Fa d_reclen -entry is the length, in bytes, of the directory record. -The .Fa d_type entry is the type of the file pointed to by the directory record. The file type values are defined in @@ -112,11 +112,15 @@ may vary from 1 to \&+ 1. .Pp Entries may be separated by extra space. -The -.Fa d_reclen -entry may be used as an offset from the start of a +To get the total size of a +.Fa dirent +structure, use the +.Nm _DIRENT_DIRSIZ +macro, or use +.Nm _DIRENT_NEXT +to get a pointer to the following .Fa dirent -structure to the next structure, if any. +structure. .Pp The actual number of bytes transferred is returned. The current position pointer associated with