* sysdeps/unix/sysv/linux/mips/bits/stat.h (struct stat): Add
authorDaniel Jacobowitz <dan@codesourcery.com>
Mon, 8 May 2006 19:23:37 +0000 (19:23 +0000)
committerDaniel Jacobowitz <dan@codesourcery.com>
Mon, 8 May 2006 19:23:37 +0000 (19:23 +0000)
st_atim, st_mtim and st_ctim interface.
(struct stat64): Likewise.
* sysdeps/unix/sysv/linux/mips/kernel_stat.h (struct kernel_stat):
Replace st_atime and its padding field with st_atim.  Likewise
st_mtime/st_mtim and st_ctime/st_ctim.
* sysdeps/unix/sysv/linux/mips/xstatconv.c (__xstat_conv): Update
after above changes.
(__xstat64_conv): Likewise.

ChangeLog.mips
sysdeps/unix/sysv/linux/mips/bits/stat.h
sysdeps/unix/sysv/linux/mips/kernel_stat.h
sysdeps/unix/sysv/linux/mips/xstatconv.c

index ba14421..7106b9d 100644 (file)
@@ -1,5 +1,17 @@
 2006-05-08  Richard Sandiford  <richard@codesourcery.com>
 
+       * sysdeps/unix/sysv/linux/mips/bits/stat.h (struct stat): Add
+       st_atim, st_mtim and st_ctim interface.
+       (struct stat64): Likewise.
+       * sysdeps/unix/sysv/linux/mips/kernel_stat.h (struct kernel_stat):
+       Replace st_atime and its padding field with st_atim.  Likewise
+       st_mtime/st_mtim and st_ctime/st_ctim.
+       * sysdeps/unix/sysv/linux/mips/xstatconv.c (__xstat_conv): Update
+       after above changes.
+       (__xstat64_conv): Likewise.
+
+2006-05-08  Richard Sandiford  <richard@codesourcery.com>
+
        * sysdeps/mips/ldsodefs.h: New file.
        * sysdeps/mips/tst-audit.h: New file.
 
index 9ae38cd..2081978 100644 (file)
@@ -61,16 +61,27 @@ struct stat
     long int st_pad2[3];
     __off64_t st_size;         /* Size of file, in bytes.  */
 #endif
-    /*
-     * Actually this should be timestruc_t st_atime, st_mtime and
-     * st_ctime but we don't have it under Linux.
-     */
+#ifdef __USE_MISC
+    /* 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.  */
     long int __reserved0;
     __time_t st_mtime;         /* Time of last modification.  */
     long int __reserved1;
     __time_t st_ctime;         /* Time of last status change.  */
     long int __reserved2;
+#endif
     __blksize_t st_blksize;    /* Optimal block size for I/O.  */
 #ifndef __USE_FILE_OFFSET64
     __blkcnt_t st_blocks;      /* Number of 512-byte blocks allocated.  */
@@ -94,16 +105,24 @@ struct stat64
     unsigned long int st_rdev; /* Device number, if device.  */
     long int st_pad2[3];
     __off64_t st_size;         /* Size of file, in bytes.  */
-    /*
-     * Actually this should be timestruc_t st_atime, st_mtime and
-     * st_ctime but we don't have it under Linux.
-     */
+#ifdef __USE_MISC
+    /* 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.  */
     long int __reserved0;
     __time_t st_mtime;         /* Time of last modification.  */
     long int __reserved1;
     __time_t st_ctime;         /* Time of last status change.  */
     long int __reserved2;
+#endif
     __blksize_t st_blksize;    /* Optimal block size for I/O.  */
     long int st_pad3;
     __blkcnt64_t st_blocks;    /* Number of 512-byte blocks allocated.  */
@@ -133,12 +152,27 @@ struct stat
     unsigned int st_pad2[3];   /* Reserved for st_rdev expansion  */
     __off64_t st_size;
 #endif
+#ifdef __USE_MISC
+    /* 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;
     int __reserved0;
     __time_t st_mtime;
     int __reserved1;
     __time_t st_ctime;
     int __reserved2;
+#endif
     __blksize_t st_blksize;
     unsigned int st_pad4;
 #ifndef __USE_FILE_OFFSET64
@@ -162,12 +196,24 @@ struct stat64
     __dev_t st_rdev;
     unsigned int st_pad2[3];   /* Reserved for st_rdev expansion  */
     __off64_t st_size;
+#ifdef __USE_MISC
+    /* 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;
     int __reserved0;
     __time_t st_mtime;
     int __reserved1;
     __time_t st_ctime;
     int __reserved2;
+#endif
     __blksize_t st_blksize;
     unsigned int st_pad3;
     __blkcnt64_t st_blocks;
index cab1e71..9de33df 100644 (file)
@@ -16,12 +16,9 @@ struct kernel_stat
     unsigned int st_rdev;
     unsigned int __pad2[3];
     long long st_size;
-    unsigned int st_atime;
-    unsigned int __unused1;
-    unsigned int st_mtime;
-    unsigned int __unused2;
-    unsigned int st_ctime;
-    unsigned int __unused3;
+    struct timespec st_atim;
+    struct timespec st_mtim;
+    struct timespec st_ctim;
     unsigned int st_blksize;
     unsigned int __pad3;
     unsigned long long st_blocks;
@@ -40,12 +37,9 @@ struct kernel_stat
     long int __pad2[2];
     long int st_size;
     long int __pad3;
-    long int st_atime;
-    long int __unused1;
-    long int st_mtime;
-    long int __unused2;
-    long int st_ctime;
-    long int __unused3;
+    struct timespec st_atim;
+    struct timespec st_mtim;
+    struct timespec st_ctim;
     long int st_blksize;
     long int st_blocks;
     char st_fstype[16];                        /* Filesystem type name, unsupported */
index 41d1cbb..a2c8e84 100644 (file)
@@ -62,9 +62,9 @@ __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
        buf->st_blksize = kbuf->st_blksize;
        buf->st_blocks = kbuf->st_blocks;
 
-       buf->st_atime = kbuf->st_atime; buf->__reserved0 = 0;
-       buf->st_mtime = kbuf->st_mtime; buf->__reserved1 = 0;
-       buf->st_ctime = kbuf->st_ctime; buf->__reserved2 = 0;
+       buf->st_atim = kbuf->st_atim;
+       buf->st_mtim = kbuf->st_mtim;
+       buf->st_ctim = kbuf->st_ctim;
 
        buf->st_pad5[0] = 0; buf->st_pad5[1] = 0;
        buf->st_pad5[2] = 0; buf->st_pad5[3] = 0;
@@ -107,9 +107,9 @@ __xstat64_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
        buf->st_blksize = kbuf->st_blksize;
        buf->st_blocks = kbuf->st_blocks;
 
-       buf->st_atime = kbuf->st_atime; buf->__reserved0 = 0;
-       buf->st_mtime = kbuf->st_mtime; buf->__reserved1 = 0;
-       buf->st_ctime = kbuf->st_ctime; buf->__reserved2 = 0;
+       buf->st_atim = kbuf->st_atim;
+       buf->st_mtim = kbuf->st_mtim;
+       buf->st_ctim = kbuf->st_ctim;
 
        buf->st_pad4[0] = 0; buf->st_pad4[1] = 0;
        buf->st_pad4[2] = 0; buf->st_pad4[3] = 0;