kernel_stat.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #ifndef _BITS_STAT_STRUCT_H
  2. #define _BITS_STAT_STRUCT_H
  3. /* This file provides whatever this particular arch's kernel thinks
  4. * struct kernel_stat should look like... It turns out each arch has a
  5. * different opinion on the subject... */
  6. #include <sgidefs.h>
  7. #if _MIPS_SIM == _MIPS_SIM_ABI64
  8. typedef struct {
  9. unsigned int tv_sec;
  10. unsigned int tv_nsec;
  11. } __ktimespec_t;
  12. #else
  13. typedef struct {
  14. time_t tv_sec;
  15. unsigned long tv_nsec;
  16. } __ktimespec_t;
  17. #endif
  18. #if _MIPS_SIM == _MIPS_SIM_ABI64
  19. /* The memory layout is the same as of struct stat64 of the 32-bit kernel. */
  20. struct kernel_stat {
  21. __kernel_dev_t st_dev;
  22. unsigned int st_pad1[3];
  23. __kernel_ino_t st_ino;
  24. __kernel_mode_t st_mode;
  25. __kernel_nlink_t st_nlink;
  26. __kernel_uid_t st_uid;
  27. __kernel_gid_t st_gid;
  28. __kernel_dev_t st_rdev;
  29. unsigned int st_pad2[3];
  30. __kernel_off_t st_size;
  31. __ktimespec_t st_atim;
  32. __ktimespec_t st_mtim;
  33. __ktimespec_t st_ctim;
  34. unsigned int st_blksize;
  35. unsigned int reserved3;
  36. unsigned long st_blocks;
  37. };
  38. #define kernel_stat64 kernel_stat
  39. #elif _MIPS_SIM == _MIPS_SIM_NABI32
  40. /* The memory layout is the same as of struct stat64 of the 32-bit kernel. */
  41. struct kernel_stat {
  42. unsigned int st_dev;
  43. unsigned int st_pad1[3];
  44. unsigned long long st_ino;
  45. __kernel_mode_t st_mode;
  46. __kernel_nlink_t st_nlink;
  47. __kernel_uid_t st_uid;
  48. __kernel_gid_t st_gid;
  49. unsigned int st_rdev;
  50. unsigned int st_pad2[3];
  51. unsigned long long st_size;
  52. __ktimespec_t st_atim;
  53. __ktimespec_t st_mtim;
  54. __ktimespec_t st_ctim;
  55. unsigned int st_blksize;
  56. unsigned int reserved3;
  57. unsigned long long st_blocks;
  58. };
  59. #define kernel_stat64 kernel_stat
  60. #else /* O32 */
  61. struct kernel_stat {
  62. __kernel_dev_t st_dev;
  63. long st_pad1[3];
  64. __kernel_ino_t st_ino;
  65. __kernel_mode_t st_mode;
  66. __kernel_nlink_t st_nlink;
  67. __kernel_uid_t st_uid;
  68. __kernel_gid_t st_gid;
  69. __kernel_dev_t st_rdev;
  70. long st_pad2[2];
  71. __kernel_off_t st_size;
  72. long st_pad3;
  73. __ktimespec_t st_atim;
  74. __ktimespec_t st_mtim;
  75. __ktimespec_t st_ctim;
  76. long st_blksize;
  77. long st_blocks;
  78. long st_pad4[14];
  79. };
  80. struct kernel_stat64 {
  81. unsigned long st_dev;
  82. unsigned long st_pad0[3]; /* Reserved for st_dev expansion */
  83. unsigned long long st_ino;
  84. __kernel_mode_t st_mode;
  85. __kernel_nlink_t st_nlink;
  86. __kernel_uid_t st_uid;
  87. __kernel_gid_t st_gid;
  88. unsigned long st_rdev;
  89. unsigned long st_pad1[3]; /* Reserved for st_rdev expansion */
  90. long long st_size;
  91. __ktimespec_t st_atim;
  92. __ktimespec_t st_mtim;
  93. __ktimespec_t st_ctim;
  94. unsigned long st_blksize;
  95. unsigned long st_pad2;
  96. long long st_blocks;
  97. };
  98. #endif /* O32 */
  99. #endif /* _BITS_STAT_STRUCT_H */