~ubuntu-branches/ubuntu/utopic/eglibc/utopic

« back to all changes in this revision

Viewing changes to debian/patches/hurd-i386/tg-struct_stat.diff

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2012-10-26 05:14:58 UTC
  • mfrom: (1.5.1) (4.4.22 experimental)
  • Revision ID: package-import@ubuntu.com-20121026051458-oryotr4i03ob5pab
Tags: 2.16-0ubuntu1
* Merge with unreleased 2.16 in Debian experimental, remaining changes:
  - Drop the Breaks line from libc6, which refers to a Debian transition
  - Remove the libc6 recommends on libc6-i686, which we don't build
  - Enable libc6{,-dev}-armel on armhf and libc6{-dev}-armhf on armel
  - Ship update-locale and validlocale in /usr/sbin in libc-bin
  - Don't build locales or locales-all in Ubuntu, we rely on langpacks
  - Heavily mangle the way we do service restarting on major upgrades
  - Use different MIN_KERNEL_SUPPORTED versions than Debian, due to
    buildd needs.  This should be universally bumped to 3.2.0 once all
    our buildds (including the PPA guests) are running precise kernels
  - Build i386 variants as -march=i686, build amd64 with -O3, and build
    ppc64 variants (both 64-bit and 32-bit) with -O3 -fno-tree-vectorize
  - Re-enable unsubmitted-ldconfig-cache-abi.diff and rebuild the cache
    on upgrades from previous versions that used a different constant
  - debian/patches/any/local-CVE-2012-3406.diff: switch to malloc when
    array grows too large to handle via alloca extension (CVE-2012-3406)
  - Build generic i386/i686 flavour with -mno-tls-direct-seg-refs
* Changes added/dropped with this merge while reducing our delta:
  - Stop building glibc docs from the eglibc source, and instead make
    the glibc-docs stub have a hard dependency on glibc-doc-reference
  - Remove outdated conflicts against ancient versions of ia32-libs
  - Drop the tzdata dependency from libc6, it's in required and minimal
  - Use gcc-4.7/g++-4.7 by default on all our supported architectures
  - Save our historical changelog as changelog.ubuntu in the source
  - Drop nscd's libaudit build-dep for now, as libaudit is in universe
  - Drop the unnecessary Breaks from libc6 to locales and locales-all
  - Ship xen's ld.so.conf.d snippet as /etc/ld.so.conf.d/libc6-xen.conf
* Disable hard failures on the test suite for the first upload to raring

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From: Thomas Schwinge <thomas@schwinge.name>
2
 
Subject: [PATCH] struct_stat
3
 
 
4
 
``struct stat'' fixes.
5
 
 
6
 
Needed for HEAD and glibc-2_7-branch.
7
 
 
8
 
<http://sources.redhat.com/ml/libc-alpha/2002-12/msg00011.html>
9
 
 
10
 
Reported on <http://savannah.gnu.org/bugs/?18216>.
11
 
 
12
 
 
13
 
2007-10-05  Thomas Schwinge  <tschwinge@gnu.org>
14
 
 
15
 
        * sysdeps/mach/hurd/bits/stat.h (struct stat): Align to what is done
16
 
        for Linux: use nsec instead of usec, as well as:
17
 
        [__USE_MISC] (st_atim, st_mtim, st_ctim): Provide these ``struct
18
 
        timespec''s.
19
 
        (struct stat64): Likewise.
20
 
        (_STATBUF_ST_NSEC): Define.
21
 
        * sysdeps/mach/hurd/xstatconv.c (xstat64_conv): Adapt to that.
22
 
 
23
 
---
24
 
 sysdeps/mach/hurd/bits/stat.h |   56 +++++++++++++++++++++++++++++++---------
25
 
 sysdeps/mach/hurd/xstatconv.c |    9 ++----
26
 
 2 files changed, 46 insertions(+), 19 deletions(-)
27
 
 
28
 
diff --git a/sysdeps/mach/hurd/bits/stat.h b/sysdeps/mach/hurd/bits/stat.h
29
 
index b64a658..50d18c4 100644
30
 
--- a/sysdeps/mach/hurd/bits/stat.h
31
 
+++ b/sysdeps/mach/hurd/bits/stat.h
32
 
@@ -59,12 +59,27 @@ struct stat
33
 
     __off64_t st_size;         /* Size in bytes.  */
34
 
 #endif
35
 
 
36
 
-    __time_t st_atime;         /* Access time, seconds */
37
 
-    unsigned long int st_atime_usec; /* and microseconds.  */
38
 
-    __time_t st_mtime;         /* Modification time, seconds */
39
 
-    unsigned long int st_mtime_usec; /* and microseconds.  */
40
 
-    __time_t st_ctime;         /* Status change time, seconds */
41
 
-    unsigned long int st_ctime_usec; /* and microseconds.  */
42
 
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
43
 
+    /* Nanosecond resolution timestamps are stored in a format
44
 
+       equivalent to 'struct timespec'.  This is the type used
45
 
+       whenever possible but the Unix namespace rules do not allow the
46
 
+       identifier 'timespec' to appear in the <sys/stat.h> header.
47
 
+       Therefore we have to handle the use of this header in strictly
48
 
+       standard-compliant sources special.  */
49
 
+    struct timespec st_atim;           /* Time of last access.  */
50
 
+    struct timespec st_mtim;           /* Time of last modification.  */
51
 
+    struct timespec st_ctim;           /* Time of last status change.  */
52
 
+# define st_atime st_atim.tv_sec       /* Backward compatibility.  */
53
 
+# define st_mtime st_mtim.tv_sec
54
 
+# define st_ctime st_ctim.tv_sec
55
 
+#else
56
 
+    __time_t st_atime;                 /* Time of last access.  */
57
 
+    unsigned long int st_atimensec;    /* Nscecs of last access.  */
58
 
+    __time_t st_mtime;                 /* Time of last modification.  */
59
 
+    unsigned long int st_mtimensec;    /* Nsecs of last modification.  */
60
 
+    __time_t st_ctime;                 /* Time of last status change.  */
61
 
+    unsigned long int st_ctimensec;    /* Nsecs of last status change.  */
62
 
+#endif
63
 
 
64
 
     __blksize_t st_blksize;    /* Optimal size for I/O.  */
65
 
 
66
 
@@ -108,12 +123,24 @@ struct stat64
67
 
 
68
 
     __off64_t st_size;         /* Size in bytes.  */
69
 
 
70
 
-    __time_t st_atime;         /* Access time, seconds */
71
 
-    unsigned long int st_atime_usec; /* and microseconds.  */
72
 
-    __time_t st_mtime;         /* Modification time, seconds */
73
 
-    unsigned long int st_mtime_usec; /* and microseconds.  */
74
 
-    __time_t st_ctime;         /* Status change time, seconds */
75
 
-    unsigned long int st_ctime_usec; /* and microseconds.  */
76
 
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
77
 
+    /* Nanosecond resolution timestamps are stored in a format
78
 
+       equivalent to 'struct timespec'.  This is the type used
79
 
+       whenever possible but the Unix namespace rules do not allow the
80
 
+       identifier 'timespec' to appear in the <sys/stat.h> header.
81
 
+       Therefore we have to handle the use of this header in strictly
82
 
+       standard-compliant sources special.  */
83
 
+    struct timespec st_atim;           /* Time of last access.  */
84
 
+    struct timespec st_mtim;           /* Time of last modification.  */
85
 
+    struct timespec st_ctim;           /* Time of last status change.  */
86
 
+#else
87
 
+    __time_t st_atime;                 /* Time of last access.  */
88
 
+    unsigned long int st_atimensec;    /* Nscecs of last access.  */
89
 
+    __time_t st_mtime;                 /* Time of last modification.  */
90
 
+    unsigned long int st_mtimensec;    /* Nsecs of last modification.  */
91
 
+    __time_t st_ctime;                 /* Time of last status change.  */
92
 
+    unsigned long int st_ctimensec;    /* Nsecs of last status change.  */
93
 
+#endif
94
 
 
95
 
     __blksize_t st_blksize;    /* Optimal size for I/O.  */
96
 
 
97
 
@@ -131,7 +158,10 @@ struct stat64
98
 
   };
99
 
 #endif
100
 
 
101
 
-#define        _STATBUF_ST_BLKSIZE     /* Tell code we have this member.  */
102
 
+/* Tell code we have these members.  */
103
 
+#define        _STATBUF_ST_BLKSIZE
104
 
+/* Nanosecond resolution time values are supported.  */
105
 
+#define _STATBUF_ST_NSEC
106
 
 
107
 
 /* Encoding of the file mode.  */
108
 
 
109
 
diff --git a/sysdeps/mach/hurd/xstatconv.c b/sysdeps/mach/hurd/xstatconv.c
110
 
index e28643c..d320285 100644
111
 
--- a/sysdeps/mach/hurd/xstatconv.c
112
 
+++ b/sysdeps/mach/hurd/xstatconv.c
113
 
@@ -42,12 +42,9 @@ xstat64_conv (struct stat *buf, const struct stat64 *buf64)
114
 
   buf->st_uid = buf64->st_uid;
115
 
   buf->st_gid = buf64->st_gid;
116
 
   buf->st_size = buf64->st_size;
117
 
-  buf->st_atime = buf64->st_atime;
118
 
-  buf->st_atime_usec = buf64->st_atime_usec;
119
 
-  buf->st_mtime = buf64->st_mtime;
120
 
-  buf->st_mtime_usec = buf64->st_mtime_usec;
121
 
-  buf->st_ctime = buf64->st_ctime;
122
 
-  buf->st_ctime_usec = buf64->st_ctime_usec;
123
 
+  buf->st_atim = buf64->st_atim;
124
 
+  buf->st_mtim = buf64->st_mtim;
125
 
+  buf->st_ctim = buf64->st_ctim;
126
 
   buf->st_blksize = buf64->st_blksize;
127
 
   buf->st_blocks = buf64->st_blocks;
128
 
   buf->st_author = buf64->st_author;
129
 
tg: (0234227..) t/struct_stat (depends on: baseline)