From bafa990748d8dc500c15ac8f7c98d25f726d8f5d Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Fri, 7 Feb 1992 01:46:50 -0800 Subject: [PATCH] extracted from SCCS-vsn: sys/sys/dirent.h 7.1 --- usr/src/sys/sys/dirent.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 usr/src/sys/sys/dirent.h diff --git a/usr/src/sys/sys/dirent.h b/usr/src/sys/sys/dirent.h new file mode 100644 index 0000000000..32ff210a3c --- /dev/null +++ b/usr/src/sys/sys/dirent.h @@ -0,0 +1,31 @@ +/*- + * Copyright (c) 1989 The Regents of the University of California. + * All rights reserved. + * + * %sccs.include.redist.c% + * + * @(#)dirent.h 7.1 (Berkeley) %G% + */ + +/* + * 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 +}; -- 2.20.1