~ubuntu-branches/ubuntu/precise/eglibc/precise

« back to all changes in this revision

Viewing changes to debian/patches/hurd-i386/submitted-stat.diff

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2011-10-04 17:48:26 UTC
  • mfrom: (216.1.23 oneiric)
  • Revision ID: package-import@ubuntu.com-20111004174826-2cyb9ewn3ucymlsx
Tags: 2.13-20ubuntu5
libc6-dev: Don't break the current {gnat,gcj}-4.4-base versons. LP: #853688.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Needed for HEAD and glibc-2_7-branch.
 
2
 
 
3
 
 
4
<http://sources.redhat.com/ml/libc-alpha/2002-12/msg00011.html>
 
5
 
 
6
Reported on <http://savannah.gnu.org/bugs/?18216>.
 
7
 
 
8
 
 
9
2007-10-05  Thomas Schwinge  <tschwinge@gnu.org>
 
10
 
 
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
 
14
        timespec''s.
 
15
        (struct stat64): Likewise.
 
16
        (_STATBUF_ST_NSEC): Define.
 
17
        * sysdeps/mach/hurd/xstatconv.c (xstat64_conv): Adapt to that.
 
18
 
 
19
---
 
20
 sysdeps/mach/hurd/bits/stat.h |   56 ++++++++++++++++++++++++++++++++----------
 
21
 sysdeps/mach/hurd/xstatconv.c |    9 ++----
 
22
 2 files changed, 46 insertions(+), 19 deletions(-)
 
23
 
 
24
--- a/sysdeps/mach/hurd/xstatconv.c
 
25
+++ b/sysdeps/mach/hurd/xstatconv.c
 
26
@@ -42,12 +42,9 @@
 
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
 
44
@@ -59,12 +59,27 @@
 
45
     __off64_t st_size;         /* Size in bytes.  */
 
46
 #endif
 
47
 
 
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.  */
 
54
+#ifdef __USE_MISC
 
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
 
67
+#else
 
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.  */
 
74
+#endif
 
75
 
 
76
     __blksize_t st_blksize;    /* Optimal size for I/O.  */
 
77
 
 
78
@@ -108,12 +123,24 @@
 
79
 
 
80
     __off64_t st_size;         /* Size in bytes.  */
 
81
 
 
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.  */
 
88
+#ifdef __USE_MISC
 
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.  */
 
98
+#else
 
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.  */
 
105
+#endif
 
106
 
 
107
     __blksize_t st_blksize;    /* Optimal size for I/O.  */
 
108
 
 
109
@@ -131,7 +158,10 @@
 
110
   };
 
111
 #endif
 
112
 
 
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
 
118
 
 
119
 /* Encoding of the file mode.  */
 
120