summaryrefslogtreecommitdiff
path: root/libc/sysdeps
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-07-26 15:17:21 -0400
committerMike Frysinger <vapier@gentoo.org>2009-07-26 15:17:21 -0400
commit8bf1bb4bf1c7a58f9f9b64f599ed5a8eaeefe3a6 (patch)
treef9a6f84e9ef69d361e0cedda34b06ca70fdb90b5 /libc/sysdeps
parent984f70a1b02a6abaeea73de73900742e06bc2d46 (diff)
enable nanosecond stat support for everyone
Fill out the stat structure so that the nanosecond resolution support is always available. There is a small code size increase for a few ports (three additional assignments in xstatconv), but otherwise everything should remain the same. While we're here, punt __old_kernel_stat from the few headers that still define it as it is unused in uClibc and causes compile errors after these nanosecond changes. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'libc/sysdeps')
-rw-r--r--libc/sysdeps/linux/alpha/bits/kernel_stat.h9
-rw-r--r--libc/sysdeps/linux/alpha/bits/stat.h2
-rw-r--r--libc/sysdeps/linux/arm/bits/kernel_stat.h20
-rw-r--r--libc/sysdeps/linux/avr32/bits/kernel_stat.h22
-rw-r--r--libc/sysdeps/linux/bfin/bits/kernel_stat.h18
-rw-r--r--libc/sysdeps/linux/common/bits/stat.h4
-rw-r--r--libc/sysdeps/linux/common/xstatconv.c22
-rw-r--r--libc/sysdeps/linux/cris/bits/kernel_stat.h34
-rw-r--r--libc/sysdeps/linux/e1/bits/kernel_stat.h18
-rw-r--r--libc/sysdeps/linux/frv/bits/kernel_stat.h22
-rw-r--r--libc/sysdeps/linux/h8300/bits/kernel_stat.h18
-rw-r--r--libc/sysdeps/linux/hppa/bits/kernel_stat.h20
-rw-r--r--libc/sysdeps/linux/i386/bits/kernel_stat.h18
-rw-r--r--libc/sysdeps/linux/ia64/bits/kernel_stat.h30
-rw-r--r--libc/sysdeps/linux/ia64/bits/stat.h4
-rw-r--r--libc/sysdeps/linux/m68k/bits/kernel_stat.h18
-rw-r--r--libc/sysdeps/linux/m68k/bits/stat.h4
-rw-r--r--libc/sysdeps/linux/microblaze/bits/kernel_stat.h20
-rw-r--r--libc/sysdeps/linux/mips/bits/kernel_stat.h38
-rw-r--r--libc/sysdeps/linux/mips/bits/stat.h78
-rw-r--r--libc/sysdeps/linux/nios/bits/stat.h41
-rw-r--r--libc/sysdeps/linux/nios2/bits/kernel_stat.h18
-rw-r--r--libc/sysdeps/linux/nios2/bits/stat.h41
-rw-r--r--libc/sysdeps/linux/powerpc/bits/kernel_stat.h19
-rw-r--r--libc/sysdeps/linux/powerpc/bits/stat.h8
-rw-r--r--libc/sysdeps/linux/sh/bits/kernel_stat.h20
-rw-r--r--libc/sysdeps/linux/sh64/bits/kernel_stat.h20
-rw-r--r--libc/sysdeps/linux/sparc/bits/kernel_stat.h19
-rw-r--r--libc/sysdeps/linux/sparc/bits/stat.h4
-rw-r--r--libc/sysdeps/linux/v850/bits/kernel_stat.h20
-rw-r--r--libc/sysdeps/linux/vax/bits/kernel_stat.h18
-rw-r--r--libc/sysdeps/linux/x86_64/bits/kernel_stat.h26
-rw-r--r--libc/sysdeps/linux/x86_64/bits/stat.h4
-rw-r--r--libc/sysdeps/linux/xtensa/bits/kernel_stat.h20
-rw-r--r--libc/sysdeps/linux/xtensa/bits/stat.h4
35 files changed, 292 insertions, 409 deletions
diff --git a/libc/sysdeps/linux/alpha/bits/kernel_stat.h b/libc/sysdeps/linux/alpha/bits/kernel_stat.h
index 649257b7e..8279a3915 100644
--- a/libc/sysdeps/linux/alpha/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/alpha/bits/kernel_stat.h
@@ -40,12 +40,9 @@ struct kernel_stat64 {
unsigned int st_nlink;
unsigned int __pad0;
- unsigned long st_atime;
- unsigned long st_atimensec;
- unsigned long st_mtime;
- unsigned long st_mtimensec;
- unsigned long st_ctime;
- unsigned long st_ctimensec;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
long __unused[3];
};
diff --git a/libc/sysdeps/linux/alpha/bits/stat.h b/libc/sysdeps/linux/alpha/bits/stat.h
index 148c6ff70..40b685343 100644
--- a/libc/sysdeps/linux/alpha/bits/stat.h
+++ b/libc/sysdeps/linux/alpha/bits/stat.h
@@ -41,7 +41,7 @@
Use neat tidy anonymous unions and structures when possible. */
-#if 0 /*def __USE_MISC*/
+#ifdef __USE_MISC
# if __GNUC_PREREQ(3,3)
# define __ST_TIME(X) \
__extension__ union { \
diff --git a/libc/sysdeps/linux/arm/bits/kernel_stat.h b/libc/sysdeps/linux/arm/bits/kernel_stat.h
index 2533573b8..2ca63a223 100644
--- a/libc/sysdeps/linux/arm/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/arm/bits/kernel_stat.h
@@ -9,8 +9,6 @@
* struct kernel_stat should look like... It turns out each arch has a
* different opinion on the subject... */
-#define STAT_HAVE_NSEC 1
-
struct kernel_stat {
#if defined(__ARMEB__)
unsigned short st_dev;
@@ -32,12 +30,9 @@ struct kernel_stat {
unsigned long st_size;
unsigned long st_blksize;
unsigned long st_blocks;
- unsigned long st_atime;
- unsigned long st_atime_nsec;
- unsigned long st_mtime;
- unsigned long st_mtime_nsec;
- unsigned long st_ctime;
- unsigned long st_ctime_nsec;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long __unused4;
unsigned long __unused5;
};
@@ -60,12 +55,9 @@ struct kernel_stat64 {
unsigned long st_blksize;
unsigned long long st_blocks; /* Number 512-byte blocks allocated. */
- unsigned long st_atime;
- unsigned long st_atime_nsec;
- unsigned long st_mtime;
- unsigned long st_mtime_nsec;
- unsigned long st_ctime;
- unsigned long st_ctime_nsec;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long long st_ino;
#ifndef __ARM_EABI__
} __attribute__((packed));
diff --git a/libc/sysdeps/linux/avr32/bits/kernel_stat.h b/libc/sysdeps/linux/avr32/bits/kernel_stat.h
index f97d23bc5..8442c3c1c 100644
--- a/libc/sysdeps/linux/avr32/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/avr32/bits/kernel_stat.h
@@ -21,18 +21,13 @@ struct kernel_stat {
unsigned long st_size;
unsigned long st_blksize;
unsigned long st_blocks;
- unsigned long st_atime;
- unsigned long st_atime_nsec;
- unsigned long st_mtime;
- unsigned long st_mtime_nsec;
- unsigned long st_ctime;
- unsigned long st_ctime_nsec;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long __unused4;
unsigned long __unused5;
};
-#define STAT_HAVE_NSEC 1
-
struct kernel_stat64 {
unsigned long long st_dev;
@@ -51,14 +46,9 @@ struct kernel_stat64 {
unsigned long long st_blocks;
- unsigned long st_atime;
- unsigned long st_atime_nsec;
-
- unsigned long st_mtime;
- unsigned long st_mtime_nsec;
-
- unsigned long st_ctime;
- unsigned long st_ctime_nsec;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long __unused1;
unsigned long __unused2;
diff --git a/libc/sysdeps/linux/bfin/bits/kernel_stat.h b/libc/sysdeps/linux/bfin/bits/kernel_stat.h
index 8c7ba0533..b1a3251e5 100644
--- a/libc/sysdeps/linux/bfin/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/bfin/bits/kernel_stat.h
@@ -22,12 +22,9 @@ struct kernel_stat {
unsigned long st_size;
unsigned long st_blksize;
unsigned long st_blocks;
- unsigned long st_atime;
- unsigned long __unused1;
- unsigned long st_mtime;
- unsigned long __unused2;
- unsigned long st_ctime;
- unsigned long __unused3;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long __unused4;
unsigned long __unused5;
};
@@ -47,12 +44,9 @@ struct kernel_stat64 {
unsigned long st_blksize;
unsigned long st_blocks; /* Number 512-byte blocks allocated. */
unsigned long __pad4; /* future possible st_blocks high bits */
- unsigned long st_atime;
- unsigned long __pad5;
- unsigned long st_mtime;
- unsigned long __pad6;
- unsigned long st_ctime;
- unsigned long __pad7; /* will be high 32 bits of ctime someday */
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long long st_ino;
};
diff --git a/libc/sysdeps/linux/common/bits/stat.h b/libc/sysdeps/linux/common/bits/stat.h
index ef6203943..5fb868d02 100644
--- a/libc/sysdeps/linux/common/bits/stat.h
+++ b/libc/sysdeps/linux/common/bits/stat.h
@@ -62,7 +62,7 @@ struct stat
#else
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
#endif
-#if 0 /*def __USE_MISC*/
+#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
@@ -108,7 +108,7 @@ struct stat64
__blksize_t st_blksize; /* Optimal block size for I/O. */
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
-#if 0 /*def __USE_MISC*/
+#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
diff --git a/libc/sysdeps/linux/common/xstatconv.c b/libc/sysdeps/linux/common/xstatconv.c
index abcb496b8..e575b26f2 100644
--- a/libc/sysdeps/linux/common/xstatconv.c
+++ b/libc/sysdeps/linux/common/xstatconv.c
@@ -41,14 +41,9 @@ void attribute_hidden __xstat_conv(struct kernel_stat *kbuf, struct stat *buf)
buf->st_size = kbuf->st_size;
buf->st_blksize = kbuf->st_blksize;
buf->st_blocks = kbuf->st_blocks;
- buf->st_atime = kbuf->st_atime;
- buf->st_mtime = kbuf->st_mtime;
- buf->st_ctime = kbuf->st_ctime;
-#ifdef STAT_HAVE_NSEC
- buf->st_atimensec = kbuf->st_atime_nsec;
- buf->st_mtimensec = kbuf->st_mtime_nsec;
- buf->st_ctimensec = kbuf->st_ctime_nsec;
-#endif
+ buf->st_atim = kbuf->st_atim;
+ buf->st_mtim = kbuf->st_mtim;
+ buf->st_ctim = kbuf->st_ctim;
}
#ifdef __UCLIBC_HAS_LFS__
@@ -70,14 +65,9 @@ void attribute_hidden __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *
buf->st_size = kbuf->st_size;
buf->st_blksize = kbuf->st_blksize;
buf->st_blocks = kbuf->st_blocks;
- buf->st_atime = kbuf->st_atime;
- buf->st_mtime = kbuf->st_mtime;
- buf->st_ctime = kbuf->st_ctime;
-# ifdef STAT_HAVE_NSEC
- buf->st_atimensec = kbuf->st_atime_nsec;
- buf->st_mtimensec = kbuf->st_mtime_nsec;
- buf->st_ctimensec = kbuf->st_ctime_nsec;
-# endif
+ buf->st_atim = kbuf->st_atim;
+ buf->st_mtim = kbuf->st_mtim;
+ buf->st_ctim = kbuf->st_ctim;
}
#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/libc/sysdeps/linux/cris/bits/kernel_stat.h b/libc/sysdeps/linux/cris/bits/kernel_stat.h
index 50202e542..b54f29210 100644
--- a/libc/sysdeps/linux/cris/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/cris/bits/kernel_stat.h
@@ -7,20 +7,6 @@
#error bits/kernel_stat.h is for internal uClibc use only!
#endif
-struct __old_kernel_stat {
- unsigned short st_dev;
- unsigned short st_ino;
- unsigned short st_mode;
- unsigned short st_nlink;
- unsigned short st_uid;
- unsigned short st_gid;
- unsigned short st_rdev;
- unsigned long st_size;
- unsigned long st_atime;
- unsigned long st_mtime;
- unsigned long st_ctime;
-};
-
struct kernel_stat {
unsigned short st_dev;
unsigned short __pad1;
@@ -34,12 +20,9 @@ struct kernel_stat {
unsigned long st_size;
unsigned long st_blksize;
unsigned long st_blocks;
- unsigned long st_atime;
- unsigned long __unused1;
- unsigned long st_mtime;
- unsigned long __unused2;
- unsigned long st_ctime;
- unsigned long __unused3;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long __unused4;
unsigned long __unused5;
};
@@ -69,14 +52,9 @@ struct kernel_stat64 {
unsigned long st_blocks; /* Number 512-byte blocks allocated. */
unsigned long __pad4; /* future possible st_blocks high bits */
- unsigned long st_atime;
- unsigned long __pad5;
-
- unsigned long st_mtime;
- unsigned long __pad6;
-
- unsigned long st_ctime;
- unsigned long __pad7; /* will be high 32 bits of ctime someday */
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long long st_ino;
};
diff --git a/libc/sysdeps/linux/e1/bits/kernel_stat.h b/libc/sysdeps/linux/e1/bits/kernel_stat.h
index 9be9d115d..2b432cf52 100644
--- a/libc/sysdeps/linux/e1/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/e1/bits/kernel_stat.h
@@ -22,12 +22,9 @@ struct kernel_stat {
unsigned long st_size;
unsigned long st_blksize;
unsigned long st_blocks;
- unsigned long st_atime;
- unsigned long __unused1;
- unsigned long st_mtime;
- unsigned long __unused2;
- unsigned long st_ctime;
- unsigned long __unused3;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long __unused4;
unsigned long __unused5;
};
@@ -47,12 +44,9 @@ struct kernel_stat64 {
unsigned long st_blksize;
unsigned long st_blocks; /* Number 512-byte blocks allocated. */
unsigned long __pad4; /* future possible st_blocks high bits */
- unsigned long st_atime;
- unsigned long __pad5;
- unsigned long st_mtime;
- unsigned long __pad6;
- unsigned long st_ctime;
- unsigned long __pad7; /* will be high 32 bits of ctime someday */
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long long st_ino;
};
diff --git a/libc/sysdeps/linux/frv/bits/kernel_stat.h b/libc/sysdeps/linux/frv/bits/kernel_stat.h
index 8b80a2608..634066df6 100644
--- a/libc/sysdeps/linux/frv/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/frv/bits/kernel_stat.h
@@ -38,14 +38,9 @@ struct kernel_stat {
unsigned long __pad10; /* future possible st_blocks high bits */
unsigned long st_blocks; /* Number 512-byte blocks allocated. */
- unsigned long __unused1;
- unsigned long st_atime;
-
- unsigned long __unused2;
- unsigned long st_mtime;
-
- unsigned long __unused3;
- unsigned long st_ctime;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long long __unused4;
};
@@ -73,14 +68,9 @@ struct kernel_stat64 {
unsigned long __pad4; /* future possible st_blocks high bits */
unsigned long st_blocks; /* Number 512-byte blocks allocated. */
- unsigned long __unused1;
- unsigned long st_atime;
-
- unsigned long __unused2;
- unsigned long st_mtime;
-
- unsigned long __unused3; /* will be high 32 bits of ctime someday */
- unsigned long st_ctime;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long long __unused4;
};
diff --git a/libc/sysdeps/linux/h8300/bits/kernel_stat.h b/libc/sysdeps/linux/h8300/bits/kernel_stat.h
index c779ba378..2b95465b7 100644
--- a/libc/sysdeps/linux/h8300/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/h8300/bits/kernel_stat.h
@@ -22,12 +22,9 @@ struct kernel_stat {
unsigned long st_size;
unsigned long st_blksize;
unsigned long st_blocks;
- unsigned long st_atime;
- unsigned long __unused1;
- unsigned long st_mtime;
- unsigned long __unused2;
- unsigned long st_ctime;
- unsigned long __unused3;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long __unused4;
unsigned long __unused5;
};
@@ -47,12 +44,9 @@ struct kernel_stat64 {
unsigned long st_blksize;
unsigned long st_blocks; /* Number 512-byte blocks allocated. */
unsigned long __pad4; /* future possible st_blocks high bits */
- unsigned long st_atime;
- unsigned long __pad5;
- unsigned long st_mtime;
- unsigned long __pad6;
- unsigned long st_ctime;
- unsigned long __pad7; /* will be high 32 bits of ctime someday */
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long long st_ino;
};
diff --git a/libc/sysdeps/linux/hppa/bits/kernel_stat.h b/libc/sysdeps/linux/hppa/bits/kernel_stat.h
index e4d784e91..d33a7e720 100644
--- a/libc/sysdeps/linux/hppa/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/hppa/bits/kernel_stat.h
@@ -17,12 +17,9 @@ struct kernel_stat {
unsigned short st_reserved2; /* old st_gid */
unsigned int st_rdev;
off_t st_size;
- time_t st_atime;
- unsigned int st_atime_nsec;
- time_t st_mtime;
- unsigned int st_mtime_nsec;
- time_t st_ctime;
- unsigned int st_ctime_nsec;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
int st_blksize;
int st_blocks;
unsigned int __unused1; /* ACL stuff */
@@ -39,8 +36,6 @@ struct kernel_stat {
unsigned int st_spare4[3];
};
-#define STAT_HAVE_NSEC 1
-
/* This is the struct that 32-bit userspace applications are expecting.
* How 64-bit apps are going to be compiled, I have no idea. But at least
* this way, we don't have a wrapper in the kernel.
@@ -60,12 +55,9 @@ struct kernel_stat64 {
signed int st_blksize;
signed long long st_blocks;
- signed int st_atime;
- unsigned int st_atime_nsec;
- signed int st_mtime;
- unsigned int st_mtime_nsec;
- signed int st_ctime;
- unsigned int st_ctime_nsec;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long long st_ino;
};
diff --git a/libc/sysdeps/linux/i386/bits/kernel_stat.h b/libc/sysdeps/linux/i386/bits/kernel_stat.h
index 6bec170b8..decbeb915 100644
--- a/libc/sysdeps/linux/i386/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/i386/bits/kernel_stat.h
@@ -21,12 +21,9 @@ struct kernel_stat {
unsigned long st_size;
unsigned long st_blksize;
unsigned long st_blocks;
- unsigned long st_atime;
- unsigned long __unused1;
- unsigned long st_mtime;
- unsigned long __unused2;
- unsigned long st_ctime;
- unsigned long __unused3;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long __unused4;
unsigned long __unused5;
};
@@ -46,12 +43,9 @@ struct kernel_stat64 {
unsigned long st_blksize;
unsigned long st_blocks; /* Number 512-byte blocks allocated. */
unsigned long __pad4; /* future possible st_blocks high bits */
- unsigned long st_atime;
- unsigned long __pad5;
- unsigned long st_mtime;
- unsigned long __pad6;
- unsigned long st_ctime;
- unsigned long __pad7; /* will be high 32 bits of ctime someday */
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long long st_ino;
};
diff --git a/libc/sysdeps/linux/ia64/bits/kernel_stat.h b/libc/sysdeps/linux/ia64/bits/kernel_stat.h
index c67c92d16..5af7e93a8 100644
--- a/libc/sysdeps/linux/ia64/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/ia64/bits/kernel_stat.h
@@ -23,38 +23,14 @@ struct kernel_stat {
unsigned int __pad0;
unsigned long st_rdev;
unsigned long st_size;
- unsigned long st_atime;
- unsigned long st_atime_nsec;
- unsigned long st_mtime;
- unsigned long st_mtime_nsec;
- unsigned long st_ctime;
- unsigned long st_ctime_nsec;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long st_blksize;
long st_blocks;
unsigned long __unused[3];
};
-#define STAT_HAVE_NSEC 1
-
-struct __old_kernel_stat {
- unsigned int st_dev;
- unsigned int st_ino;
- unsigned int st_mode;
- unsigned int st_nlink;
- unsigned int st_uid;
- unsigned int st_gid;
- unsigned int st_rdev;
- unsigned int __pad1;
- unsigned long st_size;
- unsigned long st_atime;
- unsigned long st_mtime;
- unsigned long st_ctime;
- unsigned int st_blksize;
- int st_blocks;
- unsigned int __unused1;
- unsigned int __unused2;
-};
-
/* ia64 stat64 is same as stat */
#define kernel_stat64 kernel_stat
diff --git a/libc/sysdeps/linux/ia64/bits/stat.h b/libc/sysdeps/linux/ia64/bits/stat.h
index a5a121b28..f6b6671c0 100644
--- a/libc/sysdeps/linux/ia64/bits/stat.h
+++ b/libc/sysdeps/linux/ia64/bits/stat.h
@@ -39,7 +39,7 @@ struct stat
int pad0;
__dev_t st_rdev; /* Device number, if device. */
__off_t st_size; /* Size of file, in bytes. */
-#if 0 /*def __USE_MISC*/
+#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
@@ -78,7 +78,7 @@ struct stat64
int pad0;
__dev_t st_rdev; /* Device number, if device. */
__off_t st_size; /* Size of file, in bytes. */
-#if 0 /*def __USE_MISC*/
+#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
diff --git a/libc/sysdeps/linux/m68k/bits/kernel_stat.h b/libc/sysdeps/linux/m68k/bits/kernel_stat.h
index e60362b54..4cb06cc97 100644
--- a/libc/sysdeps/linux/m68k/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/m68k/bits/kernel_stat.h
@@ -22,12 +22,9 @@ struct kernel_stat {
unsigned long st_size;
unsigned long st_blksize;
unsigned long st_blocks;
- unsigned long st_atime;
- unsigned long __unused1;
- unsigned long st_mtime;
- unsigned long __unused2;
- unsigned long st_ctime;
- unsigned long __unused3;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long __unused4;
unsigned long __unused5;
};
@@ -49,12 +46,9 @@ struct kernel_stat64 {
unsigned long st_blksize;
unsigned long __pad4; /* future possible st_blocks high bits */
unsigned long st_blocks; /* Number 512-byte blocks allocated. */
- unsigned long st_atime;
- unsigned long __pad5;
- unsigned long st_mtime;
- unsigned long __pad6;
- unsigned long st_ctime;
- unsigned long __pad7; /* will be high 32 bits of ctime someday */
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long long st_ino;
};
diff --git a/libc/sysdeps/linux/m68k/bits/stat.h b/libc/sysdeps/linux/m68k/bits/stat.h
index a0fefbe2b..dc06b13e2 100644
--- a/libc/sysdeps/linux/m68k/bits/stat.h
+++ b/libc/sysdeps/linux/m68k/bits/stat.h
@@ -61,7 +61,7 @@ struct stat
#else
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
#endif
-#if 0 /*def __USE_MISC*/
+#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
@@ -107,7 +107,7 @@ struct stat64
__blksize_t st_blksize; /* Optimal block size for I/O. */
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
-#if 0 /*def __USE_MISC*/
+#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
diff --git a/libc/sysdeps/linux/microblaze/bits/kernel_stat.h b/libc/sysdeps/linux/microblaze/bits/kernel_stat.h
index 248345e8b..de35488bd 100644
--- a/libc/sysdeps/linux/microblaze/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/microblaze/bits/kernel_stat.h
@@ -19,12 +19,9 @@ struct kernel_stat
__kernel_off_t st_size;
unsigned long st_blksize;
unsigned long st_blocks;
- unsigned long st_atime;
- unsigned long __unused1;
- unsigned long st_mtime;
- unsigned long __unused2;
- unsigned long st_ctime;
- unsigned long __unused3;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long __unused4;
unsigned long __unused5;
};
@@ -53,14 +50,9 @@ struct kernel_stat64
unsigned long __unused4; /* future possible st_blocks high bits */
unsigned long st_blocks; /* Number 512-byte blocks allocated. */
- unsigned long st_atime;
- unsigned long __unused5;
-
- unsigned long st_mtime;
- unsigned long __unused6;
-
- unsigned long st_ctime;
- unsigned long __unused7; /* high 32 bits of ctime someday */
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
};
#endif /* _BITS_STAT_STRUCT_H */
diff --git a/libc/sysdeps/linux/mips/bits/kernel_stat.h b/libc/sysdeps/linux/mips/bits/kernel_stat.h
index 3161562ea..dc3565acc 100644
--- a/libc/sysdeps/linux/mips/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/mips/bits/kernel_stat.h
@@ -24,12 +24,9 @@ struct kernel_stat {
__kernel_dev_t st_rdev;
unsigned int st_pad2[3];
__kernel_off_t st_size;
- unsigned int st_atime;
- unsigned int st_atime_nsec;
- unsigned int st_mtime;
- unsigned int st_mtime_nsec;
- unsigned int st_ctime;
- unsigned int st_ctime_nsec;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned int st_blksize;
unsigned int reserved3;
unsigned long st_blocks;
@@ -48,12 +45,9 @@ struct kernel_stat {
unsigned int st_rdev;
unsigned int st_pad2[3];
unsigned long long st_size;
- unsigned int st_atime;
- unsigned int st_atime_nsec;
- unsigned int st_mtime;
- unsigned int st_mtime_nsec;
- unsigned int st_ctime;
- unsigned int st_ctime_nsec;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned int st_blksize;
unsigned int reserved3;
unsigned long long st_blocks;
@@ -72,12 +66,9 @@ struct kernel_stat {
long st_pad2[2];
__kernel_off_t st_size;
long st_pad3;
- time_t st_atime;
- long st_atime_nsec;
- time_t st_mtime;
- long st_mtime_nsec;
- time_t st_ctime;
- long st_ctime_nsec;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
long st_blksize;
long st_blocks;
long st_pad4[14];
@@ -94,19 +85,14 @@ struct kernel_stat64 {
unsigned long st_rdev;
unsigned long st_pad1[3]; /* Reserved for st_rdev expansion */
long long st_size;
- time_t st_atime;
- unsigned long st_atime_nsec;
- time_t st_mtime;
- unsigned long st_mtime_nsec;
- time_t st_ctime;
- unsigned long st_ctime_nsec;
+ struct timespec st_atim;
+ struct timespec st_mtim;