diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-07-26 15:17:21 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-07-26 15:17:21 -0400 |
commit | 8bf1bb4bf1c7a58f9f9b64f599ed5a8eaeefe3a6 (patch) | |
tree | f9a6f84e9ef69d361e0cedda34b06ca70fdb90b5 /libc/sysdeps/linux/common | |
parent | 984f70a1b02a6abaeea73de73900742e06bc2d46 (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/linux/common')
-rw-r--r-- | libc/sysdeps/linux/common/bits/stat.h | 4 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/xstatconv.c | 22 |
2 files changed, 8 insertions, 18 deletions
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__ */ |