Skip to content

adjusting statvfs struct to have 32-bit values for 32-bit machines #784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions src/sys/statvfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,40 @@ pub mod vfs {
/// http://linux.die.net/man/2/statvfs
#[repr(C)]
#[derive(Debug,Copy,Clone)]
#[cfg(target_pointer_width = "32")]
pub struct Statvfs {
/// Filesystem block size. This is the value that will lead to
/// most efficient use of the filesystem
pub f_bsize: c_ulong,
/// Fragment Size -- actual minimum unit of allocation on this
/// filesystem
pub f_frsize: c_ulong,
/// Total number of blocks on the filesystem
pub f_blocks: u32,
/// Number of unused blocks on the filesystem, including those
/// reserved for root
pub f_bfree: u32,
/// Number of blocks available to non-root users
pub f_bavail: u32,
/// Total number of inodes available on the filesystem
pub f_files: u32,
/// Number of inodes available on the filesystem
pub f_ffree: u32,
/// Number of inodes available to non-root users
pub f_favail: u32,
/// File System ID
pub f_fsid: c_ulong,
/// Mount Flags
pub f_flag: FsFlags,
/// Maximum filename length
pub f_namemax: c_ulong,
/// Reserved extra space, OS-dependent
f_spare: [c_int; 6],
}

#[repr(C)]
#[derive(Debug,Copy,Clone)]
#[cfg(target_pointer_width = "64")]
pub struct Statvfs {
/// Filesystem block size. This is the value that will lead to
/// most efficient use of the filesystem
Expand Down