stat.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. #ifndef _ASM_X86_STAT_H
  2. #define _ASM_X86_STAT_H
  3. #define STAT_HAVE_NSEC 1
  4. #ifdef __i386__
  5. struct stat {
  6. unsigned long st_dev;
  7. unsigned long st_ino;
  8. unsigned short st_mode;
  9. unsigned short st_nlink;
  10. unsigned short st_uid;
  11. unsigned short st_gid;
  12. unsigned long st_rdev;
  13. unsigned long st_size;
  14. unsigned long st_blksize;
  15. unsigned long st_blocks;
  16. unsigned long st_atime;
  17. unsigned long st_atime_nsec;
  18. unsigned long st_mtime;
  19. unsigned long st_mtime_nsec;
  20. unsigned long st_ctime;
  21. unsigned long st_ctime_nsec;
  22. unsigned long __unused4;
  23. unsigned long __unused5;
  24. };
  25. /* We don't need to memset the whole thing just to initialize the padding */
  26. #define INIT_STRUCT_STAT_PADDING(st) do { \
  27. st.__unused4 = 0; \
  28. st.__unused5 = 0; \
  29. } while (0)
  30. #define STAT64_HAS_BROKEN_ST_INO 1
  31. /* This matches struct stat64 in glibc2.1, hence the absolutely
  32. * insane amounts of padding around dev_t's.
  33. */
  34. struct stat64 {
  35. unsigned long long st_dev;
  36. unsigned char __pad0[4];
  37. unsigned long __st_ino;
  38. unsigned int st_mode;
  39. unsigned int st_nlink;
  40. unsigned long st_uid;
  41. unsigned long st_gid;
  42. unsigned long long st_rdev;
  43. unsigned char __pad3[4];
  44. long long st_size;
  45. unsigned long st_blksize;
  46. /* Number 512-byte blocks allocated. */
  47. unsigned long long st_blocks;
  48. unsigned long st_atime;
  49. unsigned long st_atime_nsec;
  50. unsigned long st_mtime;
  51. unsigned int st_mtime_nsec;
  52. unsigned long st_ctime;
  53. unsigned long st_ctime_nsec;
  54. unsigned long long st_ino;
  55. };
  56. /* We don't need to memset the whole thing just to initialize the padding */
  57. #define INIT_STRUCT_STAT64_PADDING(st) do { \
  58. memset(&st.__pad0, 0, sizeof(st.__pad0)); \
  59. memset(&st.__pad3, 0, sizeof(st.__pad3)); \
  60. } while (0)
  61. #else /* __i386__ */
  62. struct stat {
  63. unsigned long st_dev;
  64. unsigned long st_ino;
  65. unsigned long st_nlink;
  66. unsigned int st_mode;
  67. unsigned int st_uid;
  68. unsigned int st_gid;
  69. unsigned int __pad0;
  70. unsigned long st_rdev;
  71. long st_size;
  72. long st_blksize;
  73. long st_blocks; /* Number 512-byte blocks allocated. */
  74. unsigned long st_atime;
  75. unsigned long st_atime_nsec;
  76. unsigned long st_mtime;
  77. unsigned long st_mtime_nsec;
  78. unsigned long st_ctime;
  79. unsigned long st_ctime_nsec;
  80. long __unused[3];
  81. };
  82. /* We don't need to memset the whole thing just to initialize the padding */
  83. #define INIT_STRUCT_STAT_PADDING(st) do { \
  84. st.__pad0 = 0; \
  85. st.__unused[0] = 0; \
  86. st.__unused[1] = 0; \
  87. st.__unused[2] = 0; \
  88. } while (0)
  89. #endif
  90. /* for 32bit emulation and 32 bit kernels */
  91. struct __old_kernel_stat {
  92. unsigned short st_dev;
  93. unsigned short st_ino;
  94. unsigned short st_mode;
  95. unsigned short st_nlink;
  96. unsigned short st_uid;
  97. unsigned short st_gid;
  98. unsigned short st_rdev;
  99. #ifdef __i386__
  100. unsigned long st_size;
  101. unsigned long st_atime;
  102. unsigned long st_mtime;
  103. unsigned long st_ctime;
  104. #else
  105. unsigned int st_size;
  106. unsigned int st_atime;
  107. unsigned int st_mtime;
  108. unsigned int st_ctime;
  109. #endif
  110. };
  111. #endif /* _ASM_X86_STAT_H */