summaryrefslogtreecommitdiffstats
path: root/sys/sys/dirent.h
diff options
context:
space:
mode:
authormike <mike@FreeBSD.org>2002-09-10 18:12:16 +0000
committermike <mike@FreeBSD.org>2002-09-10 18:12:16 +0000
commit520d2c38c6c32a552e5644201b149a8f64421551 (patch)
treefe9a9607cb3e929fc652b2ff859bbcf59ff52334 /sys/sys/dirent.h
parent13b9ff97a2054b7b53b7233e259e4ad3b4dcb312 (diff)
downloadFreeBSD-src-520d2c38c6c32a552e5644201b149a8f64421551.zip
FreeBSD-src-520d2c38c6c32a552e5644201b149a8f64421551.tar.gz
Fix namespace issues by using the relatively new visibility
primitives.
Diffstat (limited to 'sys/sys/dirent.h')
-rw-r--r--sys/sys/dirent.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/sys/dirent.h b/sys/sys/dirent.h
index 9f8cfad..951a8ef 100644
--- a/sys/sys/dirent.h
+++ b/sys/sys/dirent.h
@@ -37,6 +37,7 @@
#ifndef _SYS_DIRENT_H_
#define _SYS_DIRENT_H_
+#include <sys/cdefs.h>
#include <sys/_types.h>
/*
@@ -55,14 +56,15 @@ struct dirent {
__uint16_t d_reclen; /* length of this record */
__uint8_t d_type; /* file type, see below */
__uint8_t d_namlen; /* length of string in d_name */
-#ifdef _POSIX_SOURCE
- char d_name[255 + 1]; /* name must be no longer than this */
-#else
+#if __BSD_VISIBLE
#define MAXNAMLEN 255
char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
+#else
+ char d_name[255 + 1]; /* name must be no longer than this */
#endif
};
+#if __BSD_VISIBLE
/*
* File types
*/
@@ -87,9 +89,13 @@ struct dirent {
* the directory entry. This requires the amount of space in struct direct
* without the d_name field, plus enough space for the name with a terminating
* null byte (dp->d_namlen+1), rounded up to a 4 byte boundary.
+ *
+ * XXX although this macro is in the implementation namespace, it requires
+ * a manifest constant that is not.
*/
#define _GENERIC_DIRSIZ(dp) \
((sizeof (struct dirent) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))
+#endif /* __BSD_VISIBLE */
#ifdef _KERNEL
#define GENERIC_DIRSIZ(dp) _GENERIC_DIRSIZ(dp)
OpenPOWER on IntegriCloud