/*- * Copyright (c) 1989 The Regents of the University of California. * All rights reserved. * * %sccs.include.redist.c% * * @(#)dirent.h 7.1 (Berkeley) 02/06/92 */ /* * The dirent structure defines the format of directory entries returned by * the getdirentries(2) system call. * * A directory entry has a struct dirent at the front of it, containing its * inode number, the length of the entry, and the length of the name * contained in the entry. These are followed by the name padded to a 4 * byte boundary with null bytes. All names are guaranteed null terminated. * The maximum length of a name in a directory is MAXNAMLEN. */ struct dirent { u_long d_fileno; /* file number of entry */ u_short d_reclen; /* length of this record */ u_short d_namlen; /* length of string in d_name */ #ifdef _POSIX_SOURCE char d_name[255 + 1]; /* name must be no longer than this */ #else #define MAXNAMLEN 255 char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */ #endif };