kernel_stat.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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 stat should look like... It turns out each arch has a
  5. * different opinion on the subject... */
  6. #if __WORDSIZE == 64
  7. struct stat {
  8. unsigned long long st_dev; /* Device. */
  9. unsigned long long st_ino; /* File serial number. */
  10. unsigned int st_mode; /* File mode. */
  11. unsigned int st_nlink; /* Link count. */
  12. unsigned int st_uid; /* User ID of the file's owner. */
  13. unsigned int st_gid; /* Group ID of the file's group. */
  14. unsigned long long st_rdev; /* Device number, if device. */
  15. unsigned short int __pad2;
  16. long long st_size; /* Size of file, in bytes. */
  17. long st_blksize; /* Optimal block size for I/O. */
  18. long long st_blocks; /* Number 512-byte blocks allocated. */
  19. long st_atime; /* Time of last access. */
  20. unsigned long int __unused1;
  21. long st_mtime; /* Time of last modification. */
  22. unsigned long int __unused2;
  23. long st_ctime; /* Time of last status change. */
  24. unsigned long int __unused3;
  25. unsigned long int __unused4;
  26. unsigned long int __unused5;
  27. };
  28. struct stat64 {
  29. unsigned long long st_dev; /* Device. */
  30. unsigned long long st_ino; /* File serial number. */
  31. unsigned int st_mode; /* File mode. */
  32. unsigned int st_nlink; /* Link count. */
  33. unsigned int st_uid; /* User ID of the file's owner. */
  34. unsigned int st_gid; /* Group ID of the file's group. */
  35. unsigned long long st_rdev; /* Device number, if device. */
  36. unsigned short int __pad2;
  37. long long st_size; /* Size of file, in bytes. */
  38. long st_blksize; /* Optimal block size for I/O. */
  39. long long st_blocks; /* Number 512-byte blocks allocated. */
  40. long st_atime; /* Time of last access. */
  41. unsigned long int __unused1;
  42. long st_mtime; /* Time of last modification. */
  43. unsigned long int __unused2;
  44. long st_ctime; /* Time of last status change. */
  45. unsigned long int __unused3;
  46. unsigned long int __unused4;
  47. unsigned long int __unused5;
  48. };
  49. #else
  50. #ifndef __USE_FILE_OFFSET64
  51. struct stat {
  52. unsigned int st_dev;
  53. unsigned int st_ino;
  54. unsigned int st_mode;
  55. unsigned short st_nlink;
  56. unsigned int st_uid;
  57. unsigned int st_gid;
  58. unsigned int st_rdev;
  59. unsigned long int st_size;
  60. unsigned long st_blksize;
  61. unsigned long st_blocks;
  62. unsigned long st_atime;
  63. unsigned long __unused1;
  64. unsigned long st_mtime;
  65. unsigned long __unused2;
  66. unsigned long st_ctime;
  67. unsigned long __unused3;
  68. unsigned long __unused4;
  69. unsigned long __unused5;
  70. };
  71. #else
  72. struct stat {
  73. unsigned long long st_dev; /* Device. */
  74. unsigned long long st_ino; /* File serial number. */
  75. unsigned int st_mode; /* File mode. */
  76. unsigned int st_nlink; /* Link count. */
  77. unsigned int st_uid; /* User ID of the file's owner. */
  78. unsigned int st_gid; /* Group ID of the file's group. */
  79. unsigned long long st_rdev; /* Device number, if device. */
  80. unsigned short int __pad2;
  81. long long st_size; /* Size of file, in bytes. */
  82. long st_blksize; /* Optimal block size for I/O. */
  83. long long st_blocks; /* Number 512-byte blocks allocated. */
  84. long st_atime; /* Time of last access. */
  85. unsigned long int __unused1;
  86. long st_mtime; /* Time of last modification. */
  87. unsigned long int __unused2;
  88. long st_ctime; /* Time of last status change. */
  89. unsigned long int __unused3;
  90. unsigned long int __unused4;
  91. unsigned long int __unused5;
  92. };
  93. #endif
  94. #ifdef __USE_LARGEFILE64
  95. struct stat64 {
  96. unsigned long long st_dev; /* Device. */
  97. unsigned long long st_ino; /* File serial number. */
  98. unsigned int st_mode; /* File mode. */
  99. unsigned int st_nlink; /* Link count. */
  100. unsigned int st_uid; /* User ID of the file's owner. */
  101. unsigned int st_gid; /* Group ID of the file's group. */
  102. unsigned long long st_rdev; /* Device number, if device. */
  103. unsigned short int __pad2;
  104. long long st_size; /* Size of file, in bytes. */
  105. long st_blksize; /* Optimal block size for I/O. */
  106. long long st_blocks; /* Number 512-byte blocks allocated. */
  107. long st_atime; /* Time of last access. */
  108. unsigned long int __unused1;
  109. long st_mtime; /* Time of last modification. */
  110. unsigned long int __unused2;
  111. long st_ctime; /* Time of last status change. */
  112. unsigned long int __unused3;
  113. unsigned long int __unused4;
  114. unsigned long int __unused5;
  115. };
  116. #endif
  117. #endif
  118. #endif /* _BITS_STAT_STRUCT_H */