Rev | Line | |
---|
[1] | 1 | #ifndef _SYS_STATFS_H |
---|
| 2 | #define _SYS_STATFS_H |
---|
| 3 | |
---|
| 4 | #include <sys/cdefs.h> |
---|
| 5 | #include <endian.h> |
---|
| 6 | #include <sys/types.h> |
---|
| 7 | |
---|
| 8 | __BEGIN_DECLS |
---|
| 9 | |
---|
| 10 | typedef struct { |
---|
| 11 | int32_t __val[2]; |
---|
| 12 | } __kernel_fsid_t; |
---|
| 13 | |
---|
| 14 | #if defined(__mips64__) |
---|
| 15 | |
---|
| 16 | struct statfs { |
---|
| 17 | int64_t f_type; |
---|
| 18 | #define f_fstyp f_type |
---|
| 19 | int64_t f_bsize; |
---|
| 20 | int64_t f_frsize; /* Fragment size - unsupported */ |
---|
| 21 | int64_t f_blocks; |
---|
| 22 | int64_t f_bfree; |
---|
| 23 | int64_t f_files; |
---|
| 24 | int64_t f_ffree; |
---|
| 25 | int64_t f_bavail; |
---|
| 26 | |
---|
| 27 | /* Linux specials */ |
---|
| 28 | __kernel_fsid_t f_fsid; |
---|
| 29 | int64_t f_namelen; |
---|
| 30 | int64_t f_spare[6]; |
---|
| 31 | }; |
---|
| 32 | |
---|
| 33 | struct statfs64 { /* Same as struct statfs */ |
---|
| 34 | int64_t f_type; |
---|
| 35 | int64_t f_bsize; |
---|
| 36 | int64_t f_frsize; /* Fragment size - unsupported */ |
---|
| 37 | int64_t f_blocks; |
---|
| 38 | int64_t f_bfree; |
---|
| 39 | int64_t f_files; |
---|
| 40 | int64_t f_ffree; |
---|
| 41 | int64_t f_bavail; |
---|
| 42 | |
---|
| 43 | /* Linux specials */ |
---|
| 44 | __kernel_fsid_t f_fsid; |
---|
| 45 | int64_t f_namelen; |
---|
| 46 | int64_t f_spare[6]; |
---|
| 47 | }; |
---|
| 48 | |
---|
| 49 | #elif defined(__mips__) |
---|
| 50 | |
---|
| 51 | struct statfs { |
---|
| 52 | int32_t f_type; |
---|
| 53 | #define f_fstyp f_type |
---|
| 54 | int32_t f_bsize; |
---|
| 55 | int32_t f_frsize; /* Fragment size - unsupported */ |
---|
| 56 | int32_t f_blocks; |
---|
| 57 | int32_t f_bfree; |
---|
| 58 | int32_t f_files; |
---|
| 59 | int32_t f_ffree; |
---|
| 60 | int32_t f_bavail; |
---|
| 61 | |
---|
| 62 | /* Linux specials */ |
---|
| 63 | __kernel_fsid_t f_fsid; |
---|
| 64 | int32_t f_namelen; |
---|
| 65 | int32_t f_spare[6]; |
---|
| 66 | }; |
---|
| 67 | |
---|
| 68 | struct statfs64 { |
---|
| 69 | uint32_t f_type; |
---|
| 70 | uint32_t f_bsize; |
---|
| 71 | uint32_t f_frsize; /* Fragment size - unsupported */ |
---|
| 72 | uint32_t __pad; |
---|
| 73 | uint64_t f_blocks; |
---|
| 74 | uint64_t f_bfree; |
---|
| 75 | uint64_t f_files; |
---|
| 76 | uint64_t f_ffree; |
---|
| 77 | uint64_t f_bavail; |
---|
| 78 | __kernel_fsid_t f_fsid; |
---|
| 79 | uint32_t f_namelen; |
---|
| 80 | uint32_t f_spare[6]; |
---|
| 81 | }; |
---|
| 82 | |
---|
| 83 | #elif defined(__s390x__) |
---|
| 84 | |
---|
| 85 | /* S/390 64-bit mode */ |
---|
| 86 | |
---|
| 87 | struct statfs { |
---|
| 88 | int32_t f_type; |
---|
| 89 | int32_t f_bsize; |
---|
| 90 | int64_t f_blocks; |
---|
| 91 | int64_t f_bfree; |
---|
| 92 | int64_t f_bavail; |
---|
| 93 | int64_t f_files; |
---|
| 94 | int64_t f_ffree; |
---|
| 95 | __kernel_fsid_t f_fsid; |
---|
| 96 | int32_t f_namelen; |
---|
| 97 | int32_t f_frsize; |
---|
| 98 | int32_t f_spare[5]; |
---|
| 99 | }; |
---|
| 100 | |
---|
| 101 | struct statfs64 { |
---|
| 102 | int32_t f_type; |
---|
| 103 | int32_t f_bsize; |
---|
| 104 | int64_t f_blocks; |
---|
| 105 | int64_t f_bfree; |
---|
| 106 | int64_t f_bavail; |
---|
| 107 | int64_t f_files; |
---|
| 108 | int64_t f_ffree; |
---|
| 109 | __kernel_fsid_t f_fsid; |
---|
| 110 | int32_t f_namelen; |
---|
| 111 | int32_t f_frsize; |
---|
| 112 | int32_t f_spare[5]; |
---|
| 113 | }; |
---|
| 114 | |
---|
| 115 | #elif __WORDSIZE == 64 |
---|
| 116 | |
---|
| 117 | /* generic 64-bit */ |
---|
| 118 | |
---|
| 119 | struct statfs { |
---|
| 120 | int64_t f_type; |
---|
| 121 | int64_t f_bsize; |
---|
| 122 | int64_t f_blocks; |
---|
| 123 | int64_t f_bfree; |
---|
| 124 | int64_t f_bavail; |
---|
| 125 | int64_t f_files; |
---|
| 126 | int64_t f_ffree; |
---|
| 127 | __kernel_fsid_t f_fsid; |
---|
| 128 | int64_t f_namelen; |
---|
| 129 | int64_t f_frsize; |
---|
| 130 | int64_t f_spare[5]; |
---|
| 131 | }; |
---|
| 132 | |
---|
| 133 | struct statfs64 { |
---|
| 134 | int64_t f_type; |
---|
| 135 | int64_t f_bsize; |
---|
| 136 | int64_t f_blocks; |
---|
| 137 | int64_t f_bfree; |
---|
| 138 | int64_t f_bavail; |
---|
| 139 | int64_t f_files; |
---|
| 140 | int64_t f_ffree; |
---|
| 141 | __kernel_fsid_t f_fsid; |
---|
| 142 | int64_t f_namelen; |
---|
| 143 | int64_t f_frsize; |
---|
| 144 | int64_t f_spare[5]; |
---|
| 145 | }; |
---|
| 146 | |
---|
| 147 | #else |
---|
| 148 | |
---|
| 149 | /* generic 32-bit */ |
---|
| 150 | |
---|
| 151 | struct statfs { |
---|
| 152 | uint32_t f_type; |
---|
| 153 | uint32_t f_bsize; |
---|
| 154 | uint32_t f_blocks; |
---|
| 155 | uint32_t f_bfree; |
---|
| 156 | uint32_t f_bavail; |
---|
| 157 | uint32_t f_files; |
---|
| 158 | uint32_t f_ffree; |
---|
| 159 | __kernel_fsid_t f_fsid; |
---|
| 160 | uint32_t f_namelen; |
---|
| 161 | uint32_t f_frsize; |
---|
| 162 | uint32_t f_spare[5]; |
---|
| 163 | }; |
---|
| 164 | |
---|
| 165 | struct statfs64 { |
---|
| 166 | uint32_t f_type; |
---|
| 167 | uint32_t f_bsize; |
---|
| 168 | uint64_t f_blocks; |
---|
| 169 | uint64_t f_bfree; |
---|
| 170 | uint64_t f_bavail; |
---|
| 171 | uint64_t f_files; |
---|
| 172 | uint64_t f_ffree; |
---|
| 173 | __kernel_fsid_t f_fsid; |
---|
| 174 | uint32_t f_namelen; |
---|
| 175 | uint32_t f_frsize; |
---|
| 176 | uint32_t f_spare[5]; |
---|
| 177 | }; |
---|
| 178 | |
---|
| 179 | #endif |
---|
| 180 | |
---|
| 181 | int statfs(const char *path, struct statfs *buf) __THROW; |
---|
| 182 | int fstatfs(int fd, struct statfs *buf) __THROW; |
---|
| 183 | |
---|
| 184 | #if __WORDSIZE == 32 |
---|
| 185 | int statfs64(const char *path, struct statfs64 *buf) __THROW; |
---|
| 186 | int fstatfs64(int fd, struct statfs64 *buf) __THROW; |
---|
| 187 | |
---|
| 188 | #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 |
---|
| 189 | #define statfs statfs64 |
---|
| 190 | #define fstatfs fstatfs64 |
---|
| 191 | #endif |
---|
| 192 | #endif |
---|
| 193 | |
---|
| 194 | __END_DECLS |
---|
| 195 | |
---|
| 196 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.