kernel_stat.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. struct timespec st_atim;
  24. struct timespec st_mtim;
  25. struct timespec st_ctim;
  26. unsigned long __unused4;
  27. unsigned long __unused5;
  28. };
  29. struct kernel_stat64 {
  30. #if (__BYTE_ORDER == __BIG_ENDIAN)
  31. unsigned char __pad0b[6];
  32. unsigned short st_dev;
  33. #elif (__BYTE_ORDER == __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 (__BYTE_ORDER == __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 (__BYTE_ORDER == __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. struct timespec st_atim;
  63. struct timespec st_mtim;
  64. struct timespec st_ctim;
  65. unsigned long __unused1;
  66. unsigned long __unused2;
  67. };
  68. #endif /* _BITS_STAT_STRUCT_H */