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.
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. */
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. */
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
__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;
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;
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;