kernel_stat.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. #if defined(__UCLIBC_USE_TIME64__)
  7. #include "internal/time64_helpers.h"
  8. #endif
  9. #if __WORDSIZE == 64
  10. #define kernel_stat kernel_stat64
  11. #else
  12. struct kernel_stat {
  13. __kernel_dev_t st_dev;
  14. __kernel_ino_t st_ino;
  15. __kernel_mode_t st_mode;
  16. __kernel_nlink_t st_nlink;
  17. __kernel_uid_t st_uid;
  18. __kernel_gid_t st_gid;
  19. __kernel_dev_t st_rdev;
  20. __kernel_off_t st_size;
  21. unsigned long st_blksize;
  22. unsigned long st_blocks;
  23. #if defined(__UCLIBC_USE_TIME64__)
  24. struct __ts32_struct __st_atim32;
  25. struct __ts32_struct __st_mtim32;
  26. struct __ts32_struct __st_ctim32;
  27. #else
  28. struct timespec st_atim;
  29. struct timespec st_mtim;
  30. struct timespec st_ctim;
  31. #endif
  32. unsigned long __unused4;
  33. unsigned long __unused5;
  34. };
  35. #endif
  36. struct kernel_stat64 {
  37. unsigned long long st_dev; /* Device. */
  38. unsigned long long st_ino; /* File serial number. */
  39. unsigned int st_mode; /* File mode. */
  40. unsigned int st_nlink; /* Link count. */
  41. unsigned int st_uid; /* User ID of the file's owner. */
  42. unsigned int st_gid; /* Group ID of the file's group. */
  43. unsigned long long st_rdev; /* Device number, if device. */
  44. unsigned short int __pad2;
  45. long long st_size; /* Size of file, in bytes. */
  46. long st_blksize; /* Optimal block size for I/O. */
  47. long long st_blocks; /* Number 512-byte blocks allocated. */
  48. #if defined(__UCLIBC_USE_TIME64__)
  49. struct __ts32_struct __st_atim32;
  50. struct __ts32_struct __st_mtim32;
  51. struct __ts32_struct __st_ctim32;
  52. #else
  53. struct timespec st_atim;
  54. struct timespec st_mtim;
  55. struct timespec st_ctim;
  56. #endif
  57. unsigned long int __uclibc_unused4;
  58. unsigned long int __uclibc_unused5;
  59. };
  60. #endif /* _BITS_STAT_STRUCT_H */