summaryrefslogtreecommitdiff
path: root/sysdeps/mach/hurd/bits/stat.h
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@schwinge.name>2012-05-10 15:40:09 -0700
committerRoland McGrath <roland@hack.frob.com>2012-05-10 15:57:28 -0700
commit8e41b99fe1ae60276f8db4211d47ed2b1bacebf2 (patch)
treef2cb0a47de1b7304446470bb6b5961b37cc50a1a /sysdeps/mach/hurd/bits/stat.h
parent10589b4adb212dfde20670aacfb76aa842f42b92 (diff)
Hurd: struct timespec members in struct stat
Diffstat (limited to 'sysdeps/mach/hurd/bits/stat.h')
-rw-r--r--sysdeps/mach/hurd/bits/stat.h59
1 files changed, 44 insertions, 15 deletions
diff --git a/sysdeps/mach/hurd/bits/stat.h b/sysdeps/mach/hurd/bits/stat.h
index 15fcda117b..e6ffda8921 100644
--- a/sysdeps/mach/hurd/bits/stat.h
+++ b/sysdeps/mach/hurd/bits/stat.h
@@ -1,5 +1,4 @@
-/* Copyright (C) 1992-1994,1996,1997,1999,2000,2005,2010
- Free Software Foundation, Inc.
+/* Copyright (C) 1992-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -58,12 +57,27 @@ struct stat
__off64_t st_size; /* Size in bytes. */
#endif
- __time_t st_atime; /* Access time, seconds */
- unsigned long int st_atime_usec; /* and microseconds. */
- __time_t st_mtime; /* Modification time, seconds */
- unsigned long int st_mtime_usec; /* and microseconds. */
- __time_t st_ctime; /* Status change time, seconds */
- unsigned long int st_ctime_usec; /* and microseconds. */
+#if defined __USE_MISC || defined __USE_XOPEN2K8
+ /* Nanosecond resolution timestamps are stored in a format
+ equivalent to 'struct timespec'. This is the type used
+ whenever possible but the Unix namespace rules do not allow the
+ identifier 'timespec' to appear in the <sys/stat.h> header.
+ Therefore we have to handle the use of this header in strictly
+ standard-compliant sources special. */
+ struct timespec st_atim; /* Time of last access. */
+ struct timespec st_mtim; /* Time of last modification. */
+ struct timespec st_ctim; /* Time of last status change. */
+# define st_atime st_atim.tv_sec /* Backward compatibility. */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+ __time_t st_atime; /* Time of last access. */
+ unsigned long int st_atimensec; /* Nscecs of last access. */
+ __time_t st_mtime; /* Time of last modification. */
+ unsigned long int st_mtimensec; /* Nsecs of last modification. */
+ __time_t st_ctime; /* Time of last status change. */
+ unsigned long int st_ctimensec; /* Nsecs of last status change. */
+#endif
__blksize_t st_blksize; /* Optimal size for I/O. */
@@ -107,12 +121,24 @@ struct stat64
__off64_t st_size; /* Size in bytes. */
- __time_t st_atime; /* Access time, seconds */
- unsigned long int st_atime_usec; /* and microseconds. */
- __time_t st_mtime; /* Modification time, seconds */
- unsigned long int st_mtime_usec; /* and microseconds. */
- __time_t st_ctime; /* Status change time, seconds */
- unsigned long int st_ctime_usec; /* and microseconds. */
+#if defined __USE_MISC || defined __USE_XOPEN2K8
+ /* Nanosecond resolution timestamps are stored in a format
+ equivalent to 'struct timespec'. This is the type used
+ whenever possible but the Unix namespace rules do not allow the
+ identifier 'timespec' to appear in the <sys/stat.h> header.
+ Therefore we have to handle the use of this header in strictly
+ standard-compliant sources special. */
+ struct timespec st_atim; /* Time of last access. */
+ struct timespec st_mtim; /* Time of last modification. */
+ struct timespec st_ctim; /* Time of last status change. */
+#else
+ __time_t st_atime; /* Time of last access. */
+ unsigned long int st_atimensec; /* Nscecs of last access. */
+ __time_t st_mtime; /* Time of last modification. */
+ unsigned long int st_mtimensec; /* Nsecs of last modification. */
+ __time_t st_ctime; /* Time of last status change. */
+ unsigned long int st_ctimensec; /* Nsecs of last status change. */
+#endif
__blksize_t st_blksize; /* Optimal size for I/O. */
@@ -130,7 +156,10 @@ struct stat64
};
#endif
-#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */
+/* Tell code we have these members. */
+#define _STATBUF_ST_BLKSIZE
+/* Nanosecond resolution time values are supported. */
+#define _STATBUF_ST_NSEC
/* Encoding of the file mode. */