+
+#define __DARWIN_STRUCT_STAT64_TIMES \
+ struct timespec st_atimespec; /* time of last access */ \
+ struct timespec st_mtimespec; /* time of last data modification */ \
+ struct timespec st_ctimespec; /* time of last status change */ \
+ struct timespec st_birthtimespec; /* time of file creation(birth) */
+
+#else /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
+
+#define __DARWIN_STRUCT_STAT64_TIMES \
+ time_t st_atime; /* [XSI] Time of last access */ \
+ long st_atimensec; /* nsec of last access */ \
+ time_t st_mtime; /* [XSI] Last data modification time */ \
+ long st_mtimensec; /* last data modification nsec */ \
+ time_t st_ctime; /* [XSI] Time of last status change */ \
+ long st_ctimensec; /* nsec of last status change */ \
+ time_t st_birthtime; /* File creation time(birth) */ \
+ long st_birthtimensec; /* nsec of File creation time */
+
+#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
+
+/*
+ * This structure is used as the second parameter to the fstat64(),
+ * lstat64(), and stat64() functions, and for struct stat when
+ * __DARWIN_64_BIT_INO_T is set. __DARWIN_STRUCT_STAT64 is defined
+ * above, depending on whether we use struct timespec or the direct
+ * components.
+ *
+ * This is simillar to stat except for 64bit inode number
+ * number instead of 32bit ino_t and the addition of create(birth) time.
+ */
+#define __DARWIN_STRUCT_STAT64 { \
+ dev_t st_dev; /* [XSI] ID of device containing file */ \
+ mode_t st_mode; /* [XSI] Mode of file (see below) */ \
+ nlink_t st_nlink; /* [XSI] Number of hard links */ \
+ __darwin_ino64_t st_ino; /* [XSI] File serial number */ \
+ uid_t st_uid; /* [XSI] User ID of the file */ \
+ gid_t st_gid; /* [XSI] Group ID of the file */ \
+ dev_t st_rdev; /* [XSI] Device ID */ \
+ __DARWIN_STRUCT_STAT64_TIMES \
+ off_t st_size; /* [XSI] file size, in bytes */ \
+ blkcnt_t st_blocks; /* [XSI] blocks allocated for file */ \
+ blksize_t st_blksize; /* [XSI] optimal blocksize for I/O */ \
+ __uint32_t st_flags; /* user defined flags for file */ \
+ __uint32_t st_gen; /* file generation number */ \
+ __int32_t st_lspare; /* RESERVED: DO NOT USE! */ \
+ __int64_t st_qspare[2]; /* RESERVED: DO NOT USE! */ \
+}
+
+/*
+ * [XSI] This structure is used as the second parameter to the fstat(),
+ * lstat(), and stat() functions.
+ */
+#if __DARWIN_64_BIT_INO_T
+
+struct stat __DARWIN_STRUCT_STAT64;
+
+#else /* !__DARWIN_64_BIT_INO_T */