1 #pragma once 2 3 #ifdef __cplusplus 4 extern "C" { 5 #endif 6 7 #include <features.h> 8 9 #define __NEED_fsblkcnt_t 10 #define __NEED_fsfilcnt_t 11 #include <bits/alltypes.h> 12 13 #include <endian.h> 14 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 30 int statvfs(const char* __restrict, struct statvfs* __restrict); 31 int fstatvfs(int, struct statvfs*); 32 33 #define ST_RDONLY 1 34 #define ST_NOSUID 2 35 #define ST_NODEV 4 36 #define ST_NOEXEC 8 37 #define ST_SYNCHRONOUS 16 38 #define ST_MANDLOCK 64 39 #define ST_WRITE 128 40 #define ST_APPEND 256 41 #define ST_IMMUTABLE 512 42 #define ST_NOATIME 1024 43 #define ST_NODIRATIME 2048 44 45 #ifdef __cplusplus 46 } 47 #endif 48