kernel_stat.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 <endian.h>
  7. struct kernel_stat {
  8. unsigned short st_dev;
  9. unsigned short __pad1;
  10. unsigned long st_ino;
  11. unsigned short st_mode;
  12. unsigned short st_nlink;
  13. unsigned short st_uid;
  14. unsigned short st_gid;
  15. unsigned short st_rdev;
  16. unsigned short __pad2;
  17. unsigned long st_size;
  18. unsigned long st_blksize;
  19. unsigned long st_blocks;
  20. unsigned long st_atime;
  21. unsigned long __unused1;
  22. unsigned long st_mtime;
  23. unsigned long __unused2;
  24. unsigned long st_ctime;
  25. unsigned long __unused3;
  26. unsigned long __unused4;
  27. unsigned long __unused5;
  28. };
  29. struct kernel_stat64 {
  30. #if defined(__BIG_ENDIAN__)
  31. unsigned char __pad0b[6];
  32. unsigned short st_dev;
  33. #elif defined(__LITTLE_ENDIAN__)
  34. unsigned short st_dev;
  35. unsigned char __pad0b[6];
  36. #else
  37. #error Must know endian to build stat64 structure!
  38. #endif
  39. unsigned char __pad0[4];
  40. unsigned long st_ino;
  41. unsigned int st_mode;
  42. unsigned int st_nlink;
  43. unsigned long st_uid;
  44. unsigned long st_gid;
  45. #if defined(__BIG_ENDIAN__)
  46. unsigned char __pad3b[6];
  47. unsigned short st_rdev;
  48. #else /* Must be little */
  49. unsigned short st_rdev;
  50. unsigned char __pad3b[6];
  51. #endif
  52. unsigned char __pad3[4];
  53. long long st_size;
  54. unsigned long st_blksize;
  55. #if defined(__BIG_ENDIAN__)
  56. unsigned long __pad4; /* Future possible st_blocks hi bits */
  57. unsigned long st_blocks; /* Number 512-byte blocks allocated. */
  58. #else /* Must be little */
  59. unsigned long st_blocks; /* Number 512-byte blocks allocated. */
  60. unsigned long __pad4; /* Future possible st_blocks hi bits */
  61. #endif
  62. unsigned long st_atime;
  63. unsigned long __pad5;
  64. unsigned long st_mtime;
  65. unsigned long __pad6;
  66. unsigned long st_ctime;
  67. unsigned long __pad7; /* will be high 32 bits of ctime someday */
  68. unsigned long __unused1;
  69. unsigned long __unused2;
  70. };
  71. #endif /* _BITS_STAT_STRUCT_H */