summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2002-07-10 05:21:14 +0000
committerbde <bde@FreeBSD.org>2002-07-10 05:21:14 +0000
commitbc0fd33965e54aa0fe4d5a89c266629a43dce59e (patch)
treec780a0c0ca9aad60c3a56cc31c53148c20060ba0
parentc96eb5e89db76e4803fe0e3b2c88e8d469886c81 (diff)
downloadFreeBSD-src-bc0fd33965e54aa0fe4d5a89c266629a43dce59e.zip
FreeBSD-src-bc0fd33965e54aa0fe4d5a89c266629a43dce59e.tar.gz
Fixed compiling with -D_POSIX_SOURCE. The previous commit was supposed to
fix this, but actually broke it a little differently by adding 2 invalid references to struct timespec while fixing 1.
-rw-r--r--sys/sys/stat.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/sys/stat.h b/sys/sys/stat.h
index ea7c740..9452dd3 100644
--- a/sys/sys/stat.h
+++ b/sys/sys/stat.h
@@ -58,6 +58,10 @@ typedef _BSD_FFLAGS_T_ fflags_t; /* file flags */
#include <sys/time.h>
#endif
+#ifdef _POSIX_SOURCE
+#include <sys/_timespec.h>
+#endif
+
#ifdef _KERNEL
#define __dev_t udev_t
#else
@@ -112,10 +116,6 @@ struct stat {
int32_t st_lspare;
#ifndef _POSIX_SOURCE
struct timespec st_createtimespec; /* time of file creation */
-#else
- time_t st_createtime; /* time of file creation */
- long st_createtimensec; /* nsec of file creation */
-#endif
/*
* Explicitly pad st_createtimespec to 16 bytes so that the size of
* struct stat is backwards compatible. We use bitfields instead
@@ -126,6 +126,12 @@ struct stat {
*/
int :(8 / 2) * (16 - (int)sizeof(struct timespec));
int :(8 / 2) * (16 - (int)sizeof(struct timespec));
+#else
+ time_t st_createtime; /* time of file creation */
+ long st_createtimensec; /* nsec of file creation */
+ int :(8 / 2) * (16 - (int)sizeof(struct __timespec));
+ int :(8 / 2) * (16 - (int)sizeof(struct __timespec));
+#endif
};
#ifndef _POSIX_SOURCE
OpenPOWER on IntegriCloud