Skip to content

Fix statfs for DragonFlyBSD #2364

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

Merged
merged 1 commit into from
Aug 25, 2021
Merged
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
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],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have constants that we could use here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The C source defines MFSNAMELEN and MNAMELEN, but I don't see any equivalents in rust's libc. I can add these as constants if you'd prefer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, none of the other targets use a constant. I guess it's fine as it is.

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