|
26 | 26 | pub int_n_sign_posn: ::c_char,
|
27 | 27 | }
|
28 | 28 |
|
29 |
| - pub struct statfs { |
30 |
| - pub f_flags: ::uint32_t, |
31 |
| - pub f_bsize: ::uint32_t, |
32 |
| - pub f_iosize: ::uint32_t, |
33 |
| - pub f_blocks: ::uint64_t, |
34 |
| - pub f_bfree: ::uint64_t, |
35 |
| - pub f_bavail: ::int64_t, |
36 |
| - pub f_files: ::uint64_t, |
37 |
| - pub f_ffree: ::uint64_t, |
38 |
| - pub f_favail: ::int64_t, |
39 |
| - pub f_syncwrites: ::uint64_t, |
40 |
| - pub f_syncreads: ::uint64_t, |
41 |
| - pub f_asyncwrites: ::uint64_t, |
42 |
| - pub f_asyncreads: ::uint64_t, |
43 |
| - pub f_fsid: ::fsid_t, |
44 |
| - pub f_namemax: ::uint32_t, |
45 |
| - pub f_owner: ::uid_t, |
46 |
| - pub f_ctime: ::uint64_t, |
47 |
| - pub f_fstypename: [::c_char; 16], |
48 |
| - pub f_mntonname: [::c_char; 90], |
49 |
| - pub f_mntfromname: [::c_char; 90], |
50 |
| - pub f_mntfromspec: [::c_char; 90], |
51 |
| - pub mount_info: mount_info, |
52 |
| - } |
53 |
| - |
54 |
| - #[cfg(libc_union)] |
55 | 29 | pub union mount_info {
|
56 | 30 | pub ufs_args: ufs_args,
|
57 | 31 | pub mfs_args: mfs_args,
|
@@ -166,6 +140,35 @@ s! {
|
166 | 140 | }
|
167 | 141 | }
|
168 | 142 |
|
| 143 | +// This type uses the union mount_info: |
| 144 | +#[cfg(libc_union)] |
| 145 | +s! { |
| 146 | + pub struct statfs { |
| 147 | + pub f_flags: ::uint32_t, |
| 148 | + pub f_bsize: ::uint32_t, |
| 149 | + pub f_iosize: ::uint32_t, |
| 150 | + pub f_blocks: ::uint64_t, |
| 151 | + pub f_bfree: ::uint64_t, |
| 152 | + pub f_bavail: ::int64_t, |
| 153 | + pub f_files: ::uint64_t, |
| 154 | + pub f_ffree: ::uint64_t, |
| 155 | + pub f_favail: ::int64_t, |
| 156 | + pub f_syncwrites: ::uint64_t, |
| 157 | + pub f_syncreads: ::uint64_t, |
| 158 | + pub f_asyncwrites: ::uint64_t, |
| 159 | + pub f_asyncreads: ::uint64_t, |
| 160 | + pub f_fsid: ::fsid_t, |
| 161 | + pub f_namemax: ::uint32_t, |
| 162 | + pub f_owner: ::uid_t, |
| 163 | + pub f_ctime: ::uint64_t, |
| 164 | + pub f_fstypename: [::c_char; 16], |
| 165 | + pub f_mntonname: [::c_char; 90], |
| 166 | + pub f_mntfromname: [::c_char; 90], |
| 167 | + pub f_mntfromspec: [::c_char; 90], |
| 168 | + pub mount_info: mount_info, |
| 169 | + } |
| 170 | +} |
| 171 | + |
169 | 172 | //https://github.com/openbsd/src/blob/master/sys/sys/mount.h
|
170 | 173 | pub const ISOFSMNT_NORRIP: ::c_int = 0x1; // disable Rock Ridge Ext
|
171 | 174 | pub const ISOFSMNT_GENS: ::c_int = 0x2; // enable generation numbers
|
@@ -262,7 +265,10 @@ extern {
|
262 | 265 | maxval: ::c_longlong,
|
263 | 266 | errstr: *mut *const ::c_char) -> ::c_longlong;
|
264 | 267 |
|
| 268 | + // these functions use statfs which uses the union mount_info: |
| 269 | + #[cfg(libc_union)] |
265 | 270 | pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
|
| 271 | + #[cfg(libc_union)] |
266 | 272 | pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
|
267 | 273 |
|
268 | 274 | pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
|
|
0 commit comments