statvfs.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef _SYS_STATVFS_H
  2. #define _SYS_STATVFS_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <features.h>
  7. #define __NEED_fsblkcnt_t
  8. #define __NEED_fsfilcnt_t
  9. #include <bits/alltypes.h>
  10. #include <endian.h>
  11. struct statvfs {
  12. unsigned long f_bsize, f_frsize;
  13. fsblkcnt_t f_blocks, f_bfree, f_bavail;
  14. fsfilcnt_t f_files, f_ffree, f_favail;
  15. #if __BYTE_ORDER == __LITTLE_ENDIAN
  16. unsigned long f_fsid;
  17. unsigned :8*(2*sizeof(int)-sizeof(long));
  18. #else
  19. unsigned :8*(2*sizeof(int)-sizeof(long));
  20. unsigned long f_fsid;
  21. #endif
  22. unsigned long f_flag, f_namemax;
  23. int __reserved[6];
  24. };
  25. int statvfs (const char *__restrict, struct statvfs *__restrict);
  26. int fstatvfs (int, struct statvfs *);
  27. #define ST_RDONLY 1
  28. #define ST_NOSUID 2
  29. #define ST_NODEV 4
  30. #define ST_NOEXEC 8
  31. #define ST_SYNCHRONOUS 16
  32. #define ST_MANDLOCK 64
  33. #define ST_WRITE 128
  34. #define ST_APPEND 256
  35. #define ST_IMMUTABLE 512
  36. #define ST_NOATIME 1024
  37. #define ST_NODIRATIME 2048
  38. #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
  39. #define statvfs64 statvfs
  40. #define fstatvfs64 fstatvfs
  41. #define fsblkcnt64_t fsblkcnt_t
  42. #define fsfilcnt64_t fsfilcnt_t
  43. #endif
  44. #ifdef __cplusplus
  45. }
  46. #endif
  47. #endif