Skip to main content

libc/new/glibc/sysdeps/unix/linux/bits/
statvfs.rs

1//! Header: `sysdeps/unix/sysv/linux/bits/statvfs.h`
2
3use crate::prelude::*;
4
5s2! {
6    pub struct statvfs {
7        pub f_bsize: c_ulong,
8        pub f_frsize: c_ulong,
9        pub f_blocks: crate::fsblkcnt_t,
10        pub f_bfree: crate::fsblkcnt_t,
11        pub f_bavail: crate::fsblkcnt_t,
12        pub f_files: crate::fsfilcnt_t,
13        pub f_ffree: crate::fsfilcnt_t,
14        pub f_favail: crate::fsfilcnt_t,
15        pub f_fsid: c_ulong,
16        // Mirrors `_STATVFSBUF_F_UNUSED` in the header. x32 is excluded because
17        // its `__SYSCALL_WORDSIZE` is 64, aarch64 because glibc always sets
18        // `__WORDSIZE` to 64.
19        #[cfg(all(
20            target_pointer_width = "32",
21            not(any(target_arch = "x86_64", target_arch = "aarch64"))
22        ))]
23        __f_unused: Padding<c_int>,
24        pub f_flag: c_ulong,
25        pub f_namemax: c_ulong,
26        pub f_type: c_uint,
27        __f_spare: Padding<[c_int; 5]>,
28    }
29
30    pub struct statvfs64 {
31        pub f_bsize: c_ulong,
32        pub f_frsize: c_ulong,
33        pub f_blocks: u64,
34        pub f_bfree: u64,
35        pub f_bavail: u64,
36        pub f_files: u64,
37        pub f_ffree: u64,
38        pub f_favail: u64,
39        pub f_fsid: c_ulong,
40        // Mirrors `_STATVFSBUF_F_UNUSED` in the header. x32 is excluded because
41        // its `__SYSCALL_WORDSIZE` is 64, aarch64 because glibc always sets
42        // `__WORDSIZE` to 64.
43        #[cfg(all(
44            target_pointer_width = "32",
45            not(any(target_arch = "x86_64", target_arch = "aarch64"))
46        ))]
47        __f_unused: Padding<c_int>,
48        pub f_flag: c_ulong,
49        pub f_namemax: c_ulong,
50        pub f_type: c_uint,
51        __f_spare: Padding<[c_int; 5]>,
52    }
53}