summaryrefslogtreecommitdiffstats
path: root/libc/sysdeps/linux/mips/bits/stat.h
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/mips/bits/stat.h')
-rw-r--r--libc/sysdeps/linux/mips/bits/stat.h77
1 files changed, 70 insertions, 7 deletions
diff --git a/libc/sysdeps/linux/mips/bits/stat.h b/libc/sysdeps/linux/mips/bits/stat.h
index bb4076f05..e35d64928 100644
--- a/libc/sysdeps/linux/mips/bits/stat.h
+++ b/libc/sysdeps/linux/mips/bits/stat.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1992,95,96,97,98,99,2000,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 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
@@ -20,6 +21,8 @@
# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
#endif
+#include <sgidefs.h>
+
/* Versions of the `struct stat' data structure. */
#define _STAT_VER_LINUX_OLD 1
#define _STAT_VER_KERNEL 1
@@ -33,6 +36,7 @@
#define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */
+#if _MIPS_SIM == _ABIO32
/* Structure describing file characteristics. */
struct stat
{
@@ -62,11 +66,11 @@ struct stat
* st_ctime but we don't have it under Linux.
*/
__time_t st_atime; /* Time of last access. */
- long int __reserved0;
+ unsigned long int st_atimensec; /* Nscecs of last access. */
__time_t st_mtime; /* Time of last modification. */
- long int __reserved1;
+ unsigned long int st_mtimensec; /* Nsecs of last modification. */
__time_t st_ctime; /* Time of last status change. */
- long int __reserved2;
+ unsigned long int st_ctimensec; /* Nsecs of last status change. */
__blksize_t st_blksize; /* Optimal block size for I/O. */
#ifndef __USE_FILE_OFFSET64
__blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */
@@ -76,8 +80,38 @@ struct stat
#endif
long int st_pad5[14];
};
+#else /* N32 || N64 */
+/* The memory layout is the same as of struct stat64 of the 32-bit kernel. */
+struct stat {
+ unsigned int st_dev;
+ int st_pad1[3];
+ __ino_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.*/
+ 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.
+ */
+ int st_atime;
+ int st_atimensec;
+ int st_mtime;
+ int st_mtimensec;
+ int st_ctime;
+ int st_ctimensec;
+ int st_blksize; /* Optimal block size for I/O. */
+ int st_pad3;
+ __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */
+ int st_pad4[14];
+};
+#endif /* N32 || N64 */
#ifdef __USE_LARGEFILE64
+#if _MIPS_SIM == _ABIO32
struct stat64
{
__dev_t st_dev;
@@ -95,16 +129,45 @@ struct stat64
* st_ctime but we don't have it under Linux.
*/
__time_t st_atime; /* Time of last access. */
- long int __reserved0;
+ unsigned long int st_atimensec; /* Nscecs of last access. */
__time_t st_mtime; /* Time of last modification. */
- long int __reserved1;
+ unsigned long int st_mtimensec; /* Nsecs of last modification. */
__time_t st_ctime; /* Time of last status change. */
- long int __reserved2;
+ unsigned long int st_ctimensec; /* Nsecs of last status change. */
__blksize_t st_blksize; /* Optimal block size for I/O. */
long int st_pad3;
__blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */
long int st_pad4[14];
};
+#else /* N32 || N64 */
+/* stat64 of N32/N64 is just an alias of stat syscall. */
+struct stat64 {
+ unsigned int st_dev;
+ int st_pad1[3];
+ __ino_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.*/
+ 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.
+ */
+ int st_atime;
+ int st_atimensec;
+ int st_mtime;
+ int st_mtimensec;
+ int st_ctime;
+ int st_ctimensec;
+ int st_blksize; /* Optimal block size for I/O. */
+ int st_pad3;
+ __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */
+ int st_pad4[14];
+};
+#endif /* N32 || N64 */
#endif
/* Tell code we have these members. */