kernel_stat.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. struct timespec st_atim;
  21. struct timespec st_mtim;
  22. struct timespec st_ctim;
  23. unsigned long __uclibc_unused4;
  24. unsigned long __uclibc_unused5;
  25. };
  26. struct kernel_stat64 {
  27. #if (__BYTE_ORDER == __BIG_ENDIAN)
  28. unsigned char __pad0b[6];
  29. unsigned short st_dev;
  30. #elif (__BYTE_ORDER == __LITTLE_ENDIAN)
  31. unsigned short st_dev;
  32. unsigned char __pad0b[6];
  33. #else
  34. #error Must know endian to build stat64 structure!
  35. #endif
  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. #if (__BYTE_ORDER == __BIG_ENDIAN)
  43. unsigned char __pad3b[6];
  44. unsigned short st_rdev;
  45. #else /* Must be little */
  46. unsigned short st_rdev;
  47. unsigned char __pad3b[6];
  48. #endif
  49. unsigned char __pad3[4];
  50. long long st_size;
  51. unsigned long st_blksize;
  52. #if (__BYTE_ORDER == __BIG_ENDIAN)
  53. unsigned long __pad4; /* Future possible st_blocks hi bits */
  54. unsigned long st_blocks; /* Number 512-byte blocks allocated. */
  55. #else /* Must be little */
  56. unsigned long st_blocks; /* Number 512-byte blocks allocated. */
  57. unsigned long __pad4; /* Future possible st_blocks hi bits */
  58. #endif
  59. struct timespec st_atim;
  60. struct timespec st_mtim;
  61. struct timespec st_ctim;
  62. unsigned long __unused1;
  63. unsigned long __unused2;
  64. };
  65. #endif /* _BITS_STAT_STRUCT_H */