aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@codesourcery.com>2006-05-08 19:23:37 +0000
committerDaniel Jacobowitz <dan@codesourcery.com>2006-05-08 19:23:37 +0000
commitdab7578866433bdf07ccf6ccab8e04b33e67c547 (patch)
treeb08dc87a6b0e845c9f418b51bad0c1c88905a770
parent19723bddeda726ca40251bfa6491ee71976d2fd5 (diff)
downloadglibc-dab7578866433bdf07ccf6ccab8e04b33e67c547.tar.xz
glibc-dab7578866433bdf07ccf6ccab8e04b33e67c547.zip
* 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.
-rw-r--r--ChangeLog.mips12
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/stat.h62
-rw-r--r--sysdeps/unix/sysv/linux/mips/kernel_stat.h18
-rw-r--r--sysdeps/unix/sysv/linux/mips/xstatconv.c12
4 files changed, 78 insertions, 26 deletions
diff --git a/ChangeLog.mips b/ChangeLog.mips
index ba1442102d..7106b9da17 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -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.
diff --git a/sysdeps/unix/sysv/linux/mips/bits/stat.h b/sysdeps/unix/sysv/linux/mips/bits/stat.h
index 9ae38cd8d0..208197830c 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/stat.h
@@ -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;
diff --git a/sysdeps/unix/sysv/linux/mips/kernel_stat.h b/sysdeps/unix/sysv/linux/mips/kernel_stat.h
index cab1e7110e..9de33df263 100644
--- a/sysdeps/unix/sysv/linux/mips/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/mips/kernel_stat.h
@@ -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 */
diff --git a/sysdeps/unix/sysv/linux/mips/xstatconv.c b/sysdeps/unix/sysv/linux/mips/xstatconv.c
index 41d1cbb768..a2c8e84c4f 100644
--- a/sysdeps/unix/sysv/linux/mips/xstatconv.c
+++ b/sysdeps/unix/sysv/linux/mips/xstatconv.c
@@ -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;