stat.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef __GBLIBC_SYS_STAT_H
  2. #define __GBLIBC_SYS_STAT_H
  3. #include <stdint.h>
  4. #define STATX_TYPE (1 << 0)
  5. #define STATX_MODE (1 << 1)
  6. #define STATX_NLINK (1 << 2)
  7. #define STATX_UID (1 << 3)
  8. #define STATX_GID (1 << 4)
  9. #define STATX_ATIME (1 << 5)
  10. #define STATX_MTIME (1 << 6)
  11. #define STATX_CTIME (1 << 7)
  12. #define STATX_INO (1 << 8)
  13. #define STATX_SIZE (1 << 9)
  14. #define STATX_BLOCKS (1 << 10)
  15. #define STATX_BASIC_STATS (0x7ff)
  16. #define STATX_BTIME (1 << 11)
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. struct statx_timestamp {
  21. int64_t tv_sec;
  22. uint32_t tv_nsec;
  23. int32_t __reserved;
  24. };
  25. struct statx {
  26. uint32_t stx_mask;
  27. uint32_t stx_blksize;
  28. uint64_t stx_attributes;
  29. uint32_t stx_nlink;
  30. uint32_t stx_uid;
  31. uint32_t stx_gid;
  32. uint16_t stx_mode;
  33. uint16_t __spare0[1];
  34. uint64_t stx_ino;
  35. uint64_t stx_size;
  36. uint64_t stx_blocks;
  37. uint64_t stx_attributes_mask;
  38. struct statx_timestamp stx_atime;
  39. struct statx_timestamp stx_btime;
  40. struct statx_timestamp stx_ctime;
  41. struct statx_timestamp stx_mtime;
  42. uint32_t stx_rdev_major;
  43. uint32_t stx_rdev_minor;
  44. uint32_t stx_dev_major;
  45. uint32_t stx_dev_minor;
  46. uint64_t stx_mnt_id;
  47. uint64_t stx_dio_alignment[13];
  48. };
  49. #ifdef __cplusplus
  50. }
  51. #endif
  52. #endif