1
Needed for HEAD and glibc-2_7-branch.
4
<http://sources.redhat.com/ml/libc-alpha/2002-12/msg00011.html>
6
Reported on <http://savannah.gnu.org/bugs/?18216>.
9
2007-10-05 Thomas Schwinge <tschwinge@gnu.org>
11
* sysdeps/mach/hurd/bits/stat.h (struct stat): Align to what is done
12
for Linux: use nsec instead of usec, as well as:
13
[__USE_MISC] (st_atim, st_mtim, st_ctim): Provide these ``struct
15
(struct stat64): Likewise.
16
(_STATBUF_ST_NSEC): Define.
17
* sysdeps/mach/hurd/xstatconv.c (xstat64_conv): Adapt to that.
20
sysdeps/mach/hurd/bits/stat.h | 56 ++++++++++++++++++++++++++++++++----------
21
sysdeps/mach/hurd/xstatconv.c | 9 ++----
22
2 files changed, 46 insertions(+), 19 deletions(-)
24
--- a/sysdeps/mach/hurd/xstatconv.c
25
+++ b/sysdeps/mach/hurd/xstatconv.c
27
buf->st_uid = buf64->st_uid;
28
buf->st_gid = buf64->st_gid;
29
buf->st_size = buf64->st_size;
30
- buf->st_atime = buf64->st_atime;
31
- buf->st_atime_usec = buf64->st_atime_usec;
32
- buf->st_mtime = buf64->st_mtime;
33
- buf->st_mtime_usec = buf64->st_mtime_usec;
34
- buf->st_ctime = buf64->st_ctime;
35
- buf->st_ctime_usec = buf64->st_ctime_usec;
36
+ buf->st_atim = buf64->st_atim;
37
+ buf->st_mtim = buf64->st_mtim;
38
+ buf->st_ctim = buf64->st_ctim;
39
buf->st_blksize = buf64->st_blksize;
40
buf->st_blocks = buf64->st_blocks;
41
buf->st_author = buf64->st_author;
42
--- a/sysdeps/mach/hurd/bits/stat.h
43
+++ b/sysdeps/mach/hurd/bits/stat.h
45
__off64_t st_size; /* Size in bytes. */
48
- __time_t st_atime; /* Access time, seconds */
49
- unsigned long int st_atime_usec; /* and microseconds. */
50
- __time_t st_mtime; /* Modification time, seconds */
51
- unsigned long int st_mtime_usec; /* and microseconds. */
52
- __time_t st_ctime; /* Status change time, seconds */
53
- unsigned long int st_ctime_usec; /* and microseconds. */
55
+ /* Nanosecond resolution timestamps are stored in a format
56
+ equivalent to 'struct timespec'. This is the type used
57
+ whenever possible but the Unix namespace rules do not allow the
58
+ identifier 'timespec' to appear in the <sys/stat.h> header.
59
+ Therefore we have to handle the use of this header in strictly
60
+ standard-compliant sources special. */
61
+ struct timespec st_atim; /* Time of last access. */
62
+ struct timespec st_mtim; /* Time of last modification. */
63
+ struct timespec st_ctim; /* Time of last status change. */
64
+# define st_atime st_atim.tv_sec /* Backward compatibility. */
65
+# define st_mtime st_mtim.tv_sec
66
+# define st_ctime st_ctim.tv_sec
68
+ __time_t st_atime; /* Time of last access. */
69
+ unsigned long int st_atimensec; /* Nscecs of last access. */
70
+ __time_t st_mtime; /* Time of last modification. */
71
+ unsigned long int st_mtimensec; /* Nsecs of last modification. */
72
+ __time_t st_ctime; /* Time of last status change. */
73
+ unsigned long int st_ctimensec; /* Nsecs of last status change. */
76
__blksize_t st_blksize; /* Optimal size for I/O. */
80
__off64_t st_size; /* Size in bytes. */
82
- __time_t st_atime; /* Access time, seconds */
83
- unsigned long int st_atime_usec; /* and microseconds. */
84
- __time_t st_mtime; /* Modification time, seconds */
85
- unsigned long int st_mtime_usec; /* and microseconds. */
86
- __time_t st_ctime; /* Status change time, seconds */
87
- unsigned long int st_ctime_usec; /* and microseconds. */
89
+ /* Nanosecond resolution timestamps are stored in a format
90
+ equivalent to 'struct timespec'. This is the type used
91
+ whenever possible but the Unix namespace rules do not allow the
92
+ identifier 'timespec' to appear in the <sys/stat.h> header.
93
+ Therefore we have to handle the use of this header in strictly
94
+ standard-compliant sources special. */
95
+ struct timespec st_atim; /* Time of last access. */
96
+ struct timespec st_mtim; /* Time of last modification. */
97
+ struct timespec st_ctim; /* Time of last status change. */
99
+ __time_t st_atime; /* Time of last access. */
100
+ unsigned long int st_atimensec; /* Nscecs of last access. */
101
+ __time_t st_mtime; /* Time of last modification. */
102
+ unsigned long int st_mtimensec; /* Nsecs of last modification. */
103
+ __time_t st_ctime; /* Time of last status change. */
104
+ unsigned long int st_ctimensec; /* Nsecs of last status change. */
107
__blksize_t st_blksize; /* Optimal size for I/O. */
113
-#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */
114
+/* Tell code we have these members. */
115
+#define _STATBUF_ST_BLKSIZE
116
+/* Nanosecond resolution time values are supported. */
117
+#define _STATBUF_ST_NSEC
119
/* Encoding of the file mode. */