1 /* @(#)dirent.h 1.4 89/06/16 SMI */
4 * Filesystem-independent directory information.
5 * Directory entry structures are of variable length.
6 * Each directory entry is a struct dirent containing its file number, the
7 * offset of the next entry (a cookie interpretable only the filesystem
8 * type that generated it), the length of the entry, and the length of the
9 * name contained in the entry. These are followed by the name. The
10 * entire entry is padded with null bytes to a 4 byte boundary. All names
11 * are guaranteed null terminated. The maximum length of a name in a
12 * directory is MAXNAMLEN, plus a null byte.
15 #ifndef __sys_dirent_h
16 #define __sys_dirent_h
22 #define dirent GOO_dirent
25 long d_off; /* offset of next disk dir entry */
26 unsigned long d_fileno; /* file number of entry */
27 unsigned short d_reclen; /* length of this record */
28 unsigned short d_namlen; /* length of string in d_name */
29 char d_name[255+1]; /* name (up to MAXNAMLEN + 1) */
34 * It's unlikely to change, but make sure that sizeof d_name above is
35 * at least MAXNAMLEN + 1 (more may be added for padding).
39 * The macro DIRSIZ(dp) gives the minimum amount of space required to represent
40 * a directory entry. For any directory entry dp->d_reclen >= DIRSIZ(dp).
41 * Specific filesystem types may use this macro to construct the value
46 (((sizeof(struct dirent) - (MAXNAMLEN+1) + ((dp)->d_namlen+1)) +3) & ~3)
48 #endif /* !_POSIX_SOURCE */
54 #endif /* !__sys_dirent_h */