statvfs.h 1.2 KB

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