kernel_stat.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. #else
  29. struct stat {
  30. unsigned int st_dev;
  31. unsigned int st_ino;
  32. unsigned int st_mode;
  33. unsigned short st_nlink;
  34. unsigned int st_uid;
  35. unsigned int st_gid;
  36. unsigned int st_rdev;
  37. unsigned long int st_size;
  38. unsigned long st_blksize;
  39. unsigned long st_blocks;
  40. unsigned long st_atime;
  41. unsigned long __unused1;
  42. unsigned long st_mtime;
  43. unsigned long __unused2;
  44. unsigned long st_ctime;
  45. unsigned long __unused3;
  46. unsigned long __unused4;
  47. unsigned long __unused5;
  48. };
  49. #ifdef __USE_LARGEFILE64
  50. struct stat64 {
  51. unsigned long long st_dev; /* Device. */
  52. unsigned long long st_ino; /* File serial number. */
  53. unsigned int st_mode; /* File mode. */
  54. unsigned int st_nlink; /* Link count. */
  55. unsigned int st_uid; /* User ID of the file's owner. */
  56. unsigned int st_gid; /* Group ID of the file's group. */
  57. unsigned long long st_rdev; /* Device number, if device. */
  58. unsigned short int __pad2;
  59. long long st_size; /* Size of file, in bytes. */
  60. long st_blksize; /* Optimal block size for I/O. */
  61. long long st_blocks; /* Number 512-byte blocks allocated. */
  62. long st_atime; /* Time of last access. */
  63. unsigned long int __unused1;
  64. long st_mtime; /* Time of last modification. */
  65. unsigned long int __unused2;
  66. long st_ctime; /* Time of last status change. */
  67. unsigned long int __unused3;
  68. unsigned long int __unused4;
  69. unsigned long int __unused5;
  70. };
  71. #endif
  72. #endif
  73. #endif /* _BITS_STAT_STRUCT_H */