about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/alpha/bits
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-03-11 02:58:44 +0000
committerRichard Henderson <rth@redhat.com>2004-03-11 02:58:44 +0000
commitc72aaf4396e559936453a2ff3e8ffb31815d7874 (patch)
tree9bcdceb07f5b284925044875a34f025fd435c1c1 /sysdeps/unix/sysv/linux/alpha/bits
parent73b4ce64cc07a2732d691a4e3432cdc082d10567 (diff)
downloadglibc-c72aaf4396e559936453a2ff3e8ffb31815d7874.tar.gz
glibc-c72aaf4396e559936453a2ff3e8ffb31815d7874.tar.xz
glibc-c72aaf4396e559936453a2ff3e8ffb31815d7874.zip
* sysdeps/unix/sysv/linux/alpha/kernel_stat.h (kernel_stat64): New. (glibc21_stat): New. * sysdeps/unix/sysv/linux/alpha/fxstat.c: New file. * sysdeps/unix/sysv/linux/alpha/lxstat.c: New file. * sysdeps/unix/sysv/linux/alpha/xstat.c: New file. * sysdeps/unix/sysv/linux/alpha/xstatconv.c (__xstat_conv): Add code for _STAT_VER_GLIBC2_3_4. (__libc_missing_axp_stat64): New. * sysdeps/unix/sysv/linux/alpha/xstatconv.h: New file. * sysdeps/unix/sysv/linux/alpha/bits/stat.h (__ST_TIME): New. (_STAT_VER_GLIBC2_3_4, _STAT_VER_KERNEL64): New. (struct stat, struct stat64): Update to new format. (_STATBUF_ST_NSEC): New.
2004-03-11  Richard Henderson  <rth@redhat.com>

	* sysdeps/unix/sysv/linux/alpha/kernel_stat.h (kernel_stat64): New.
	(glibc21_stat): New.
	* sysdeps/unix/sysv/linux/alpha/fxstat.c: New file.
	* sysdeps/unix/sysv/linux/alpha/lxstat.c: New file.
	* sysdeps/unix/sysv/linux/alpha/xstat.c: New file.
	* sysdeps/unix/sysv/linux/alpha/xstatconv.c (__xstat_conv): Add
	code for _STAT_VER_GLIBC2_3_4.
	(__libc_missing_axp_stat64): New.
	* sysdeps/unix/sysv/linux/alpha/xstatconv.h: New file.
	* sysdeps/unix/sysv/linux/alpha/bits/stat.h (__ST_TIME): New.
	(_STAT_VER_GLIBC2_3_4, _STAT_VER_KERNEL64): New.
	(struct stat, struct stat64): Update to new format.
	(_STATBUF_ST_NSEC): New.
Diffstat (limited to 'sysdeps/unix/sysv/linux/alpha/bits')
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/stat.h86
1 files changed, 60 insertions, 26 deletions
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/stat.h b/sysdeps/unix/sysv/linux/alpha/bits/stat.h
index 921283a511..40b6853430 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/stat.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1996,1997,1998,1999,2000,2001,2004
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -24,11 +25,45 @@
 #define _STAT_VER_KERNEL	0
 #define _STAT_VER_GLIBC2	1
 #define _STAT_VER_GLIBC2_1	2
-#define _STAT_VER		_STAT_VER_GLIBC2_1
+#define _STAT_VER_KERNEL64	3
+#define _STAT_VER_GLIBC2_3_4	3
+#define _STAT_VER		_STAT_VER_GLIBC2_3_4
 
 /* Versions of the `xmknod' interface.  */
 #define _MKNOD_VER_LINUX	0
 
+
+/* 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.
+
+   Use neat tidy anonymous unions and structures when possible.  */
+
+#ifdef __USE_MISC
+# if __GNUC_PREREQ(3,3)
+#  define __ST_TIME(X)				\
+	__extension__ union {			\
+	    struct timespec st_##X##tim;	\
+	    struct {				\
+		__time_t st_##X##time;		\
+		unsigned long st_##X##timensec;	\
+	    };					\
+	}
+# else
+#  define __ST_TIME(X) struct timespec st_##X##tim
+#  define st_atime st_atim.tv_sec
+#  define st_mtime st_mtim.tv_sec
+#  define st_ctime st_ctim.tv_sec
+# endif
+#else
+# define __ST_TIME(X)				\
+	__time_t st_##X##time;			\
+	unsigned long st_##X##timensec
+#endif
+
+
 struct stat
   {
     __dev_t st_dev;		/* Device.  */
@@ -36,28 +71,26 @@ struct stat
     __ino64_t st_ino;		/* File serial number.  */
 #else
     __ino_t st_ino;		/* File serial number.	*/
-    int __pad1;
+    int __pad0;			/* 64-bit st_ino.  */
 #endif
-    __mode_t st_mode;		/* File mode.  */
-    __nlink_t st_nlink;		/* Link count.  */
-    __uid_t st_uid;		/* User ID of the file's owner.	*/
-    __gid_t st_gid;		/* Group ID of the file's group.*/
     __dev_t st_rdev;		/* Device number, if device.  */
     __off_t st_size;		/* Size of file, in bytes.  */
-    __time_t st_atime;		/* Time of last access.  */
-    __time_t st_mtime;		/* Time of last modification.  */
-    __time_t st_ctime;		/* Time of last status change.  */
 #ifdef __USE_FILE_OFFSET64
     __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
 #else
     __blkcnt_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
-    int __pad2;
+    int __pad1;			/* 64-bit st_blocks.  */
 #endif
+    __mode_t st_mode;		/* File mode.  */
+    __uid_t st_uid;		/* User ID of the file's owner.	*/
+    __gid_t st_gid;		/* Group ID of the file's group.*/
     __blksize_t st_blksize;	/* Optimal block size for I/O.  */
-    unsigned int st_flags;
-    unsigned int st_gen;
-    int __pad3;
-    long __unused[4];
+    __nlink_t st_nlink;		/* Link count.  */
+    int __pad2;			/* Real padding.  */
+    __ST_TIME(a);		/* Time of last access.  */
+    __ST_TIME(m);		/* Time of last modification.  */
+    __ST_TIME(c);		/* Time of last status change.  */
+    long __unused[3];
   };
 
 #ifdef __USE_LARGEFILE64
@@ -66,27 +99,28 @@ struct stat64
   {
     __dev_t st_dev;		/* Device.  */
     __ino64_t st_ino;		/* File serial number.  */
-    __mode_t st_mode;		/* File mode.  */
-    __nlink_t st_nlink;		/* Link count.  */
-    __uid_t st_uid;		/* User ID of the file's owner.	*/
-    __gid_t st_gid;		/* Group ID of the file's group.*/
     __dev_t st_rdev;		/* Device number, if device.  */
     __off_t st_size;		/* Size of file, in bytes.  */
-    __time_t st_atime;		/* Time of last access.  */
-    __time_t st_mtime;		/* Time of last modification.  */
-    __time_t st_ctime;		/* Time of last status change.  */
     __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
+    __mode_t st_mode;		/* File mode.  */
+    __uid_t st_uid;		/* User ID of the file's owner.	*/
+    __gid_t st_gid;		/* Group ID of the file's group.*/
     __blksize_t st_blksize;	/* Optimal block size for I/O.  */
-    unsigned int st_flags;
-    unsigned int st_gen;
-    int __pad3;
-    long __unused[4];
+    __nlink_t st_nlink;		/* Link count.  */
+    int __pad0;			/* Real padding.  */
+    __ST_TIME(a);		/* Time of last access.  */
+    __ST_TIME(m);		/* Time of last modification.  */
+    __ST_TIME(c);		/* Time of last status change.  */
+    long __unused[3];
   };
 #endif
 
+#undef __ST_TIME
+
 /* Tell code we have these members.  */
 #define	_STATBUF_ST_BLKSIZE
 #define _STATBUF_ST_RDEV
+#define _STATBUF_ST_NSEC
 
 /* Encoding of the file mode.  */