xref: /original-bsd/sys/sys/dir.h (revision 301158a2)
1 /*
2  * Copyright (c) 1982, 1986, 1989 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted
6  * provided that the above copyright notice and this paragraph are
7  * duplicated in all such forms and that any documentation,
8  * advertising materials, and other materials related to such
9  * distribution and use acknowledge that the software was developed
10  * by the University of California, Berkeley.  The name of the
11  * University may not be used to endorse or promote products derived
12  * from this software without specific prior written permission.
13  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  *	@(#)dir.h	7.1 (Berkeley) 02/15/90
18  */
19 
20 /*
21  * The information in this file should be obtained from <dirent.h>
22  * and is provided solely (and temporarily) for backward compatibility.
23  */
24 
25 #ifndef _DIRENT_
26 
27 #include <dirent.h>
28 
29 /*
30  * Backwards compatibility.
31  */
32 #define direct dirent
33 
34 /*
35  * The DIRSIZ macro gives the minimum record length which will hold
36  * the directory entry.  This requires the amount of space in struct direct
37  * without the d_name field, plus enough space for the name with a terminating
38  * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary.
39  */
40 #undef DIRSIZ
41 #define DIRSIZ(dp) \
42     ((sizeof (struct direct) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))
43 
44 #endif /* _DIRENT_ */
45