statfs.h 775 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) mlibc & plct lab
  3. *
  4. * SPDX-License-Identifier: MIT
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2024/8/8 0Bitbiscuits the first version
  9. */
  10. #ifndef MLIBC_SYS_STATFS_H__
  11. #define MLIBC_SYS_STATFS_H__
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #define __NEED_fsblkcnt_t
  16. #define __NEED_fsfilcnt_t
  17. #include <features.h>
  18. #include <sys/statvfs.h>
  19. typedef struct __fsid_t {
  20. int __val[2];
  21. } fsid_t;
  22. struct statfs {
  23. unsigned long f_type, f_bsize, f_frsize;
  24. fsblkcnt_t f_blocks, f_bfree;
  25. fsfilcnt_t f_files, f_ffree;
  26. fsblkcnt_t f_bavail;
  27. fsid_t f_fsid;
  28. unsigned long f_namelen, f_flags, f_spare[5];
  29. };
  30. int statfs (const char *, struct statfs *);
  31. int fstatfs (int, struct statfs *);
  32. #ifdef __cplusplus
  33. }
  34. #endif
  35. #endif