stat.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1995, 1999, 2000 Ralf Baechle
  7. * Copyright (C) 2000 Silicon Graphics, Inc.
  8. */
  9. #ifndef _ASM_STAT_H
  10. #define _ASM_STAT_H
  11. #include <linux/types.h>
  12. #include <asm/sgidefs.h>
  13. #if (_MIPS_SIM == _MIPS_SIM_ABI32) || (_MIPS_SIM == _MIPS_SIM_NABI32)
  14. struct stat {
  15. unsigned st_dev;
  16. long st_pad1[3]; /* Reserved for network id */
  17. ino_t st_ino;
  18. mode_t st_mode;
  19. __u32 st_nlink;
  20. uid_t st_uid;
  21. gid_t st_gid;
  22. unsigned st_rdev;
  23. long st_pad2[2];
  24. off_t st_size;
  25. long st_pad3;
  26. /*
  27. * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
  28. * but we don't have it under Linux.
  29. */
  30. time_t st_atime;
  31. long st_atime_nsec;
  32. time_t st_mtime;
  33. long st_mtime_nsec;
  34. time_t st_ctime;
  35. long st_ctime_nsec;
  36. long st_blksize;
  37. long st_blocks;
  38. long st_pad4[14];
  39. };
  40. /*
  41. * This matches struct stat64 in glibc2.1, hence the absolutely insane
  42. * amounts of padding around dev_t's. The memory layout is the same as of
  43. * struct stat of the 64-bit kernel.
  44. */
  45. struct stat64 {
  46. unsigned long st_dev;
  47. unsigned long st_pad0[3]; /* Reserved for st_dev expansion */
  48. unsigned long long st_ino;
  49. mode_t st_mode;
  50. __u32 st_nlink;
  51. uid_t st_uid;
  52. gid_t st_gid;
  53. unsigned long st_rdev;
  54. unsigned long st_pad1[3]; /* Reserved for st_rdev expansion */
  55. long long st_size;
  56. /*
  57. * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
  58. * but we don't have it under Linux.
  59. */
  60. time_t st_atime;
  61. unsigned long st_atime_nsec; /* Reserved for st_atime expansion */
  62. time_t st_mtime;
  63. unsigned long st_mtime_nsec; /* Reserved for st_mtime expansion */
  64. time_t st_ctime;
  65. unsigned long st_ctime_nsec; /* Reserved for st_ctime expansion */
  66. unsigned long st_blksize;
  67. unsigned long st_pad2;
  68. long long st_blocks;
  69. };
  70. #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
  71. #if _MIPS_SIM == _MIPS_SIM_ABI64
  72. /* The memory layout is the same as of struct stat64 of the 32-bit kernel. */
  73. struct stat {
  74. unsigned int st_dev;
  75. unsigned int st_pad0[3]; /* Reserved for st_dev expansion */
  76. unsigned long st_ino;
  77. mode_t st_mode;
  78. __u32 st_nlink;
  79. uid_t st_uid;
  80. gid_t st_gid;
  81. unsigned int st_rdev;
  82. unsigned int st_pad1[3]; /* Reserved for st_rdev expansion */
  83. off_t st_size;
  84. /*
  85. * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
  86. * but we don't have it under Linux.
  87. */
  88. unsigned int st_atime;
  89. unsigned int st_atime_nsec;
  90. unsigned int st_mtime;
  91. unsigned int st_mtime_nsec;
  92. unsigned int st_ctime;
  93. unsigned int st_ctime_nsec;
  94. unsigned int st_blksize;
  95. unsigned int st_pad2;
  96. unsigned long st_blocks;
  97. };
  98. #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
  99. #define STAT_HAVE_NSEC 1
  100. #endif /* _ASM_STAT_H */