xref: /original-bsd/sys/sys/dir.h (revision 333da485)
1 /*
2  * Copyright (c) 1982, 1986, 1989, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)dir.h	8.2 (Berkeley) 01/04/94
8  */
9 
10 /*
11  * The information in this file should be obtained from <dirent.h>
12  * and is provided solely (and temporarily) for backward compatibility.
13  */
14 
15 #ifndef _SYS_DIR_H_
16 #define	_SYS_DIR_H_
17 
18 #include <dirent.h>
19 
20 /*
21  * Backwards compatibility.
22  */
23 #define direct dirent
24 
25 /*
26  * The DIRSIZ macro gives the minimum record length which will hold
27  * the directory entry.  This requires the amount of space in struct direct
28  * without the d_name field, plus enough space for the name with a terminating
29  * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary.
30  */
31 #undef DIRSIZ
32 #define DIRSIZ(dp) \
33     ((sizeof (struct direct) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))
34 
35 #endif /* !_SYS_DIR_H_ */
36