Skip to content

Commit

Permalink
Auto merge of #2364 - rtzoeller:dragonflybsd_fix_statfs, r=Amanieu
Browse files Browse the repository at this point in the history
Fix statfs for DragonFlyBSD

The statfs struct was missing several padding areas and used incorrect array lengths, causing all values to be incorrect.

DragonFlyBSD's own documentation seems to be wrong here, which is likely how this ended up being incorrect in the first place.

Source: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/27ea30e396c40d8feb44d76002b79153e96ecf8f/sys/sys/mount.h#L95
Documentation: https://man.dragonflybsd.org/?command=statfs&section=2
  • Loading branch information
bors committed Aug 25, 2021
2 parents 2b9253a + f09c62c commit d16dfc4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/unix/bsd/freebsdlike/dragonfly/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ s_no_extra_traits! {
}

pub struct statfs {
__spare2: ::c_long,
pub f_bsize: ::c_long,
pub f_iosize: ::c_long,
pub f_blocks: ::c_long,
Expand All @@ -256,15 +257,18 @@ s_no_extra_traits! {
pub f_ffree: ::c_long,
pub f_fsid: ::fsid_t,
pub f_owner: ::uid_t,
pub f_type: i32,
pub f_flags: i32,
pub f_type: ::c_int,
pub f_flags: ::c_int,
pub f_syncwrites: ::c_long,
pub f_asyncwrites: ::c_long,
pub f_fstypename: [::c_char; 16],
pub f_mntonname: [::c_char; 90],
pub f_mntonname: [::c_char; 80],
pub f_syncreads: ::c_long,
pub f_asyncreads: ::c_long,
pub f_mntfromname: [::c_char; 90],
__spares1: ::c_short,
pub f_mntfromname: [::c_char; 80],
__spares2: ::c_short,
__spare: [::c_long; 2],
}

pub struct sigevent {
Expand Down

0 comments on commit d16dfc4

Please sign in to comment.