]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
struct stat is not posix conform
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Tue, 26 May 2015 16:57:23 +0000 (22:27 +0530)
committerSiddhesh Poyarekar <siddhesh@redhat.com>
Tue, 26 May 2015 16:57:24 +0000 (22:27 +0530)
On 21/05/15 05:29, Siddhesh Poyarekar wrote:
> On Wed, May 20, 2015 at 06:55:02PM +0100, Szabolcs Nagy wrote:
>> i guess it's ok for consistency if i fix struct stat64
>> too to use __USE_XOPEN2K8.
>>
>> i will run some tests and come back with a patch
>
> I also think it would be appropriate to change this code in other
> architectures (microblaze and nacl IIRC) to make all of them
> consistent.  It is a mechanical enough change IMO that all arch
> maintainer acks is not necessary.
>

here is the patch with consistent __USE_XOPEN2K8

ok to commit?

2015-05-21  Szabolcs Nagy  <szabolcs.nagy@arm.com>

[BZ #18234]
* conform/data/sys/stat.h-data (struct stat): Add tests for st_atim,
st_mtim and st_ctim members.

* sysdeps/nacl/bits/stat.h (struct stat, struct stat64): Make
st_atim, st_ctim, st_mtim visible under __USE_XOPEN2K8 only.

* sysdeps/unix/sysv/linux/generic/bits/stat.h (struct stat,):
(struct stat64): Likewise.

* sysdeps/unix/sysv/linux/ia64/bits/stat.h (struct stat,):
(struct stat64): Likewise.

* sysdeps/unix/sysv/linux/microblaze/bits/stat.h (struct stat,):
(struct stat64): Likewise.

ChangeLog
NEWS
conform/data/sys/stat.h-data
sysdeps/nacl/bits/stat.h
sysdeps/unix/sysv/linux/generic/bits/stat.h
sysdeps/unix/sysv/linux/ia64/bits/stat.h
sysdeps/unix/sysv/linux/microblaze/bits/stat.h

index f06cb9487d8ab810312efd4a16f65a595c52c8f2..f0888fc794ced0830c9cef2409c7ed8ff58877b5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2015-05-26  Szabolcs Nagy  <szabolcs.nagy@arm.com>
+
+       [BZ #18234]
+       * conform/data/sys/stat.h-data (struct stat): Add tests for st_atim,
+       st_mtim and st_ctim members.
+       * sysdeps/nacl/bits/stat.h (struct stat, struct stat64): Make
+       st_atim, st_ctim, st_mtim visible under __USE_XOPEN2K8 only.
+       * sysdeps/unix/sysv/linux/generic/bits/stat.h (struct stat,):
+       (struct stat64): Likewise.
+       * sysdeps/unix/sysv/linux/ia64/bits/stat.h (struct stat,):
+       (struct stat64): Likewise.
+       * sysdeps/unix/sysv/linux/microblaze/bits/stat.h (struct stat,):
+       (struct stat64): Likewise.
+
 2015-05-26  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
        * sysdeps/unix/sysv/linux/aarch64/gettimeofday.c (HAVE_VSYSCALL):
diff --git a/NEWS b/NEWS
index 2e47f796c3b0c11f45d479fa1ec6e811ebb17e2b..d50560a37db44372aaf0805cc7066247cd813af9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -18,8 +18,8 @@ Version 2.22
   18029, 18030, 18032, 18036, 18038, 18039, 18042, 18043, 18046, 18047,
   18049, 18068, 18080, 18093, 18100, 18104, 18110, 18111, 18125, 18128,
   18138, 18185, 18196, 18197, 18206, 18210, 18211, 18217, 18220, 18221,
-  18244, 18247, 18287, 18319, 18333, 18346, 18397, 18409, 18410, 18412,
-  18418, 18434, 18444.
+  18234, 18244, 18247, 18287, 18319, 18333, 18346, 18397, 18409, 18410,
+  18412, 18418, 18434, 18444.
 
 * Cache information can be queried via sysconf() function on s390 e.g. with
   _SC_LEVEL1_ICACHE_SIZE as argument.
index 631daa41b0cebffd200a87a337a3398ca33f2306..f5b17a31acd3b3f099b98e964165f63ec191f498 100644 (file)
@@ -39,6 +39,11 @@ element {struct stat} off_t st_size
 element {struct stat} time_t st_atime
 element {struct stat} time_t st_mtime
 element {struct stat} time_t st_ctime
+#if defined XOPEN2K8 || defined POSIX2008
+element {struct stat} {struct timespec} st_atim
+element {struct stat} {struct timespec} st_mtim
+element {struct stat} {struct timespec} st_ctim
+#endif
 #if !defined POSIX && !defined POSIX2008
 element {struct stat} blksize_t st_blksize
 element {struct stat} blkcnt_t st_blocks
index 0cd3500adb873ba21d4ac46220d78948bcf59354..9b89b15fcdf4e88f8d19d6a083f21559ec8a8f17 100644 (file)
@@ -42,7 +42,7 @@ struct stat
     __off_t st_size;           /* Size of file, in bytes.  */
     __blksize_t st_blksize;    /* Optimal block size for I/O.  */
     __blkcnt_t st_blocks;              /* Number 512-byte blocks allocated. */
-#if defined __USE_MISC || defined __USE_XOPEN2K8
+#if 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
@@ -81,7 +81,7 @@ struct stat64
     __off_t st_size;           /* Size of file, in bytes.  */
     __blksize_t st_blksize;    /* Optimal block size for I/O.  */
     __blkcnt_t st_blocks;              /* Number 512-byte blocks allocated. */
-# if defined __USE_MISC || defined __USE_XOPEN2K8
+# if 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
index 42cb198ff87900619080753fd07485dfa6d989f1..4c32f66f16b8e82a17c029725ee62129c5b6ef6f 100644 (file)
@@ -66,7 +66,7 @@ struct stat
     __blksize_t st_blksize;    /* Optimal block size for I/O.  */
     int __pad2;
     __field64(__blkcnt_t, __blkcnt64_t, st_blocks);  /* 512-byte blocks */
-#ifdef __USE_MISC
+#ifdef __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
@@ -107,7 +107,7 @@ struct stat64
     __blksize_t st_blksize;    /* Optimal block size for I/O.  */
     int __pad2;
     __blkcnt64_t st_blocks;    /* Nr. 512-byte blocks allocated.  */
-#ifdef __USE_MISC
+#ifdef __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
index c14cd7b3500b6299c4e2d9adcd7202f6ab3f0c44..ed796767c4f41e0c1244eb735dc84e632cbbcb98 100644 (file)
@@ -41,7 +41,7 @@ struct stat
     int pad0;
     __dev_t st_rdev;           /* Device number, if device.  */
     __off_t st_size;           /* Size of file, in bytes.  */
-#ifdef __USE_MISC
+#ifdef __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
@@ -80,7 +80,7 @@ struct stat64
     int pad0;
     __dev_t st_rdev;           /* Device number, if device.  */
     __off_t st_size;           /* Size of file, in bytes.  */
-#ifdef __USE_MISC
+#ifdef __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
index d45b275e932c2db39227ed72f2f7c05b175364fa..df2d306312dec6a083eedaa188802c1231f2987e 100644 (file)
@@ -50,7 +50,7 @@ struct stat
         __blksize_t     st_blksize; /* Optimal block size for I/O.  */
         int             __pad3;
         __blkcnt_t      st_blocks;  /* Number 512-byte blocks allocated.  */
-#ifdef __USE_MISC
+#ifdef __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
@@ -135,7 +135,7 @@ struct stat64
         __blksize_t             st_blksize; /* Optimal block size for I/O.  */
         int                     __pad3;
         __blkcnt64_t            st_blocks;  /* Number 512-byte blocks allocated.  */
-#ifdef __USE_MISC
+#ifdef __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