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/mips/bits | |
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/mips/bits')
-rw-r--r-- | libc/sysdeps/linux/mips/bits/kernel_stat.h | 38 | ||||
-rw-r--r-- | libc/sysdeps/linux/mips/bits/stat.h | 78 |
2 files changed, 74 insertions, 42 deletions
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; + struct timespec st_ctim; unsigned long st_blksize; unsigned long st_pad2; long long st_blocks; }; #endif /* O32 */ -#define STAT_HAVE_NSEC 1 - #endif /* _BITS_STAT_STRUCT_H */ diff --git a/libc/sysdeps/linux/mips/bits/stat.h b/libc/sysdeps/linux/mips/bits/stat.h index e35d64928..4e3814e4d 100644 --- a/libc/sysdeps/linux/mips/bits/stat.h +++ b/libc/sysdeps/linux/mips/bits/stat.h @@ -61,16 +61,27 @@ struct stat long int st_pad2[2]; __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. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ +#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. */ @@ -93,16 +104,27 @@ struct stat { unsigned int st_rdev; /* Device number, if device. */ int st_pad2[3]; __off_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. */ +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +#else int st_atime; int st_atimensec; int st_mtime; int st_mtimensec; int st_ctime; int st_ctimensec; +#endif int st_blksize; /* Optimal block size for I/O. */ int st_pad3; __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */ @@ -124,16 +146,27 @@ struct stat64 __dev_t st_rdev; /* Device number, if device. */ long int st_pad2[2]; __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. */ +# 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. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ +#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. */ @@ -152,16 +185,27 @@ struct stat64 { unsigned int st_rdev; /* Device number, if device. */ int st_pad2[3]; __off_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. */ +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +#else int st_atime; int st_atimensec; int st_mtime; int st_mtimensec; int st_ctime; int st_ctimensec; +#endif int st_blksize; /* Optimal block size for I/O. */ int st_pad3; __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */ @@ -173,6 +217,8 @@ struct stat64 { /* Tell code we have these members. */ #define _STATBUF_ST_BLKSIZE #define _STATBUF_ST_RDEV +/* Nanosecond resolution time values are supported. */ +#define _STATBUF_ST_NSEC /* Encoding of the file mode. */ |