Update of /cvsroot/bsdext2fs/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17622
Modified Files:
dirent.h
Log Message:
NetBSD's struct dirent has different layout, so it cannot be used natively.
So use FreeBSD's one with necessary additional macros.
Index: dirent.h
===================================================================
RCS file: /cvsroot/bsdext2fs/src/dirent.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- dirent.h 19 Mar 2008 23:06:36 -0000 1.1
+++ dirent.h 31 Mar 2008 11:19:41 -0000 1.2
@@ -32,39 +32,10 @@
* @(#)dirent.h 8.3 (Berkeley) 8/10/94
*/
-#ifndef _SYS_DIRENT_H_
-#define _SYS_DIRENT_H_
-
-/*
- * The dirent structure defines the format of directory entries returned by
- * the getdents(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 {
- ino_t d_fileno; /* file number of entry */
- uint16_t d_reclen; /* length of this record */
- uint16_t d_namlen; /* length of string in d_name */
- uint8_t d_type; /* file type, see below */
- char d_name[511 + 1]; /* name must be no longer than this */
-};
+#ifndef _NBSD_DIRENT_H_
+#define _NBSD_DIRENT_H_
-/*
- * File types
- */
-#define DT_UNKNOWN 0
-#define DT_FIFO 1
-#define DT_CHR 2
-#define DT_DIR 4
-#define DT_BLK 6
-#define DT_REG 8
-#define DT_LNK 10
-#define DT_SOCK 12
-#define DT_WHT 14
+#include <sys/dirent.h>
/*
* The _DIRENT_ALIGN macro returns the alignment of struct dirent.
@@ -101,10 +72,4 @@
*/
#define _DIRENT_MINSIZE(dp) _DIRENT_RECLEN(dp, 0)
-/*
- * Convert between stat structure types and directory types.
- */
-#define IFTODT(mode) (((mode) & 0170000) >> 12)
-#define DTTOIF(dirtype) ((dirtype) << 12)
-
-#endif /* !_SYS_DIRENT_H_ */
+#endif /* !_NBSD_DIRENT_H_ */
|