kernel_stat.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. #if defined(__UCLIBC_USE_TIME64__)
  15. __S32_TYPE tv_sec;
  16. #else
  17. time_t tv_sec;
  18. #endif
  19. unsigned long tv_nsec;
  20. } __ktimespec_t;
  21. #endif
  22. #if _MIPS_SIM == _MIPS_SIM_ABI64
  23. /* The memory layout is the same as of struct stat64 of the 32-bit kernel. */
  24. struct kernel_stat {
  25. __kernel_dev_t st_dev;
  26. unsigned int st_pad1[3];
  27. __kernel_ino_t st_ino;
  28. __kernel_mode_t st_mode;
  29. __kernel_nlink_t st_nlink;
  30. __kernel_uid_t st_uid;
  31. __kernel_gid_t st_gid;
  32. __kernel_dev_t st_rdev;
  33. unsigned int st_pad2[3];
  34. __kernel_off_t st_size;
  35. __ktimespec_t st_atim;
  36. __ktimespec_t st_mtim;
  37. __ktimespec_t st_ctim;
  38. unsigned int st_blksize;
  39. unsigned int reserved3;
  40. unsigned long st_blocks;
  41. };
  42. #define kernel_stat64 kernel_stat
  43. #elif _MIPS_SIM == _MIPS_SIM_NABI32
  44. /* The memory layout is the same as of struct stat64 of the 32-bit kernel. */
  45. struct kernel_stat {
  46. unsigned int st_dev;
  47. unsigned int st_pad1[3];
  48. unsigned long long st_ino;
  49. __kernel_mode_t st_mode;
  50. __kernel_nlink_t st_nlink;
  51. __kernel_uid_t st_uid;
  52. __kernel_gid_t st_gid;
  53. unsigned int st_rdev;
  54. unsigned int st_pad2[3];
  55. unsigned long long st_size;
  56. __ktimespec_t st_atim;
  57. __ktimespec_t st_mtim;
  58. __ktimespec_t st_ctim;
  59. unsigned int st_blksize;
  60. unsigned int reserved3;
  61. unsigned long long st_blocks;
  62. };
  63. #define kernel_stat64 kernel_stat
  64. #else /* O32 */
  65. struct kernel_stat {
  66. __kernel_dev_t st_dev;
  67. long st_pad1[3];
  68. __kernel_ino_t st_ino;
  69. __kernel_mode_t st_mode;
  70. __kernel_nlink_t st_nlink;
  71. __kernel_uid_t st_uid;
  72. __kernel_gid_t st_gid;
  73. __kernel_dev_t st_rdev;
  74. long st_pad2[2];
  75. __kernel_off_t st_size;
  76. long st_pad3;
  77. __ktimespec_t st_atim;
  78. __ktimespec_t st_mtim;
  79. __ktimespec_t st_ctim;
  80. long st_blksize;
  81. long st_blocks;
  82. long st_pad4[14];
  83. };
  84. struct kernel_stat64 {
  85. unsigned long st_dev;
  86. unsigned long st_pad0[3]; /* Reserved for st_dev expansion */
  87. unsigned long long st_ino;
  88. __kernel_mode_t st_mode;
  89. __kernel_nlink_t st_nlink;
  90. __kernel_uid_t st_uid;
  91. __kernel_gid_t st_gid;
  92. unsigned long st_rdev;
  93. unsigned long st_pad1[3]; /* Reserved for st_rdev expansion */
  94. long long st_size;
  95. __ktimespec_t st_atim;
  96. __ktimespec_t st_mtim;
  97. __ktimespec_t st_ctim;
  98. unsigned long st_blksize;
  99. unsigned long st_pad2;
  100. long long st_blocks;
  101. };
  102. #endif /* O32 */
  103. #endif /* _BITS_STAT_STRUCT_H */