This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
struct stat.h with nanosecond resolution
- From: Andreas Jaeger <aj at suse dot de>
- To: GNU libc alpha <libc-alpha at sources dot redhat dot com>
- Cc: ak at suse dot de
- Date: Mon, 02 Dec 2002 11:19:17 +0100
- Subject: struct stat.h with nanosecond resolution
The current linux 2.5 kernel adds nanosecond resolution to struct
stat. I've added a patch implementing this.
If this patch is ok, I'll fix all other linux <bits/stat.h> files the
same way.
Ok to commit?
Is there anything else that needs to be done for this change in glibc?
Andreas
2002-12-02 Andreas Jaeger <aj@suse.de>
* sysdeps/unix/sysv/linux/bits/stat.h: Use struct timespec for
stat and stat64 and define compatibility macros.
============================================================
Index: sysdeps/unix/sysv/linux/bits/stat.h
--- sysdeps/unix/sysv/linux/bits/stat.h 8 Feb 2002 07:48:10 -0000 1.15
+++ sysdeps/unix/sysv/linux/bits/stat.h 2 Dec 2002 10:16:28 -0000
@@ -60,12 +60,9 @@ struct stat
#else
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
#endif
- __time_t st_atime; /* Time of last access. */
- unsigned long int __unused1;
- __time_t st_mtime; /* Time of last modification. */
- unsigned long int __unused2;
- __time_t st_ctime; /* Time of last status change. */
- unsigned long int __unused3;
+ 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. */
#ifndef __USE_FILE_OFFSET64
unsigned long int __unused4;
unsigned long int __unused5;
@@ -74,6 +71,10 @@ struct stat
#endif
};
+#define st_atime st_atim.tv_sec
+#define st_mtime st_mtim.tv_sec
+#define st_ctime st_ctim.tv_sec
+
#ifdef __USE_LARGEFILE64
struct stat64
{
@@ -91,12 +92,9 @@ struct stat64
__blksize_t st_blksize; /* Optimal block size for I/O. */
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
- __time_t st_atime; /* Time of last access. */
- unsigned long int __unused1;
- __time_t st_mtime; /* Time of last modification. */
- unsigned long int __unused2;
- __time_t st_ctime; /* Time of last status change. */
- unsigned long int __unused3;
+ 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. */
__ino64_t st_ino; /* File serial number. */
};
#endif
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj