kernel_stat.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #ifndef _BITS_STAT_STRUCT_H
  2. #define _BITS_STAT_STRUCT_H
  3. #ifndef _LIBC
  4. #error bits/kernel_stat.h is for internal uClibc use only!
  5. #endif
  6. /* This file provides whatever this particular arch's kernel thinks
  7. * struct kernel_stat should look like... It turns out each arch has a
  8. * different opinion on the subject... */
  9. #include <endian.h>
  10. struct kernel_stat {
  11. unsigned short st_dev;
  12. unsigned short __pad1;
  13. unsigned long st_ino;
  14. unsigned short st_mode;
  15. unsigned short st_nlink;
  16. unsigned short st_uid;
  17. unsigned short st_gid;
  18. unsigned short st_rdev;
  19. unsigned short __pad2;
  20. unsigned long st_size;
  21. unsigned long st_blksize;
  22. unsigned long st_blocks;
  23. unsigned long st_atime;
  24. unsigned long __unused1;
  25. unsigned long st_mtime;
  26. unsigned long __unused2;
  27. unsigned long st_ctime;
  28. unsigned long __unused3;
  29. unsigned long __unused4;
  30. unsigned long __unused5;
  31. };
  32. struct kernel_stat64 {
  33. #if (__BYTE_ORDER == __BIG_ENDIAN)
  34. unsigned char __pad0b[6];
  35. unsigned short st_dev;
  36. #elif (__BYTE_ORDER == __LITTLE_ENDIAN)
  37. unsigned short st_dev;
  38. unsigned char __pad0b[6];
  39. #else
  40. #error Must know endian to build stat64 structure!
  41. #endif
  42. unsigned char __pad0[4];
  43. unsigned long st_ino;
  44. unsigned int st_mode;
  45. unsigned int st_nlink;
  46. unsigned long st_uid;
  47. unsigned long st_gid;
  48. #if (__BYTE_ORDER == __BIG_ENDIAN)
  49. unsigned char __pad3b[6];
  50. unsigned short st_rdev;
  51. #else /* Must be little */
  52. unsigned short st_rdev;
  53. unsigned char __pad3b[6];
  54. #endif
  55. unsigned char __pad3[4];
  56. long long st_size;
  57. unsigned long st_blksize;
  58. #if (__BYTE_ORDER == __BIG_ENDIAN)
  59. unsigned long __pad4; /* Future possible st_blocks hi bits */
  60. unsigned long st_blocks; /* Number 512-byte blocks allocated. */
  61. #else /* Must be little */
  62. unsigned long st_blocks; /* Number 512-byte blocks allocated. */
  63. unsigned long __pad4; /* Future possible st_blocks hi bits */
  64. #endif
  65. unsigned long st_atime;
  66. unsigned long __pad5;
  67. unsigned long st_mtime;
  68. unsigned long __pad6;
  69. unsigned long st_ctime;
  70. unsigned long __pad7; /* will be high 32 bits of ctime someday */
  71. unsigned long __unused1;
  72. unsigned long __unused2;
  73. };
  74. #endif /* _BITS_STAT_STRUCT_H */