Skip to content

Commit

Permalink
musl: Unify definitions of statfs and statfs64
Browse files Browse the repository at this point in the history
Only mips uses a special statfs(64)

[ squash "Use `#[cfg]` blocks to special-case statfs on mips", change
  this patch to only cover statfs and statfs64, include part of "Remove
  new redundant definitions" - Trevor ]

(backport <rust-lang#3261>)
(cherry picked from commit fb7785a)
  • Loading branch information
bossmc authored and tgross35 committed Nov 25, 2024
1 parent 0300828 commit ace85ee
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 290 deletions.
30 changes: 0 additions & 30 deletions src/unix/linux_like/linux/musl/b32/arm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,36 +97,6 @@ s! {
__pad2: ::c_ulong,
}

pub struct statfs {
pub f_type: ::c_ulong,
pub f_bsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_flags: ::c_ulong,
pub f_spare: [::c_ulong; 4],
}

pub struct statfs64 {
pub f_type: ::c_ulong,
pub f_bsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_flags: ::c_ulong,
pub f_spare: [::c_ulong; 4],
}

pub struct mcontext_t {
pub trap_no: ::c_ulong,
pub error_code: ::c_ulong,
Expand Down
30 changes: 0 additions & 30 deletions src/unix/linux_like/linux/musl/b32/hexagon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,36 +74,6 @@ s! {
__pad1: ::c_ulong,
__pad2: ::c_ulong,
}

pub struct statfs {
pub f_type: ::c_ulong,
pub f_bsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_flags: ::c_ulong,
pub f_spare: [::c_ulong; 4],
}

pub struct statfs64 {
pub f_type: ::c_ulong,
pub f_bsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_flags: ::c_ulong,
pub f_spare: [::c_ulong; 4],
}
}

pub const AF_FILE: ::c_int = 1;
Expand Down
30 changes: 0 additions & 30 deletions src/unix/linux_like/linux/musl/b32/powerpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,36 +96,6 @@ s! {
__pad1: ::c_ulong,
__pad2: ::c_ulong,
}

pub struct statfs {
pub f_type: ::c_ulong,
pub f_bsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_flags: ::c_ulong,
pub f_spare: [::c_ulong; 4],
}

pub struct statfs64 {
pub f_type: ::c_ulong,
pub f_bsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_flags: ::c_ulong,
pub f_spare: [::c_ulong; 4],
}
}

pub const MADV_SOFT_OFFLINE: ::c_int = 101;
Expand Down
30 changes: 0 additions & 30 deletions src/unix/linux_like/linux/musl/b32/riscv32/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,36 +52,6 @@ s! {
__unused: [::c_int; 2],
}

pub struct statfs {
pub f_type: ::c_long,
pub f_bsize: ::c_long,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_long,
pub f_frsize: ::c_long,
pub f_flags: ::c_long,
pub f_spare: [::c_long; 4],
}

pub struct statfs64 {
pub f_type: ::c_ulong,
pub f_bsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_flags: ::c_ulong,
pub f_spare: [::c_ulong; 4],
}

pub struct stack_t {
pub ss_sp: *mut ::c_void,
pub ss_flags: ::c_int,
Expand Down
30 changes: 0 additions & 30 deletions src/unix/linux_like/linux/musl/b32/x86/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,36 +100,6 @@ s! {
__pad1: ::c_ulong,
__pad2: ::c_ulong,
}

pub struct statfs {
pub f_type: ::c_ulong,
pub f_bsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_flags: ::c_ulong,
pub f_spare: [::c_ulong; 4],
}

pub struct statfs64 {
pub f_type: ::c_ulong,
pub f_bsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_flags: ::c_ulong,
pub f_spare: [::c_ulong; 4],
}
}

s_no_extra_traits! {
Expand Down
15 changes: 0 additions & 15 deletions src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,6 @@ s! {
__unused: [::c_int; 2],
}

pub struct statfs64 {
pub f_type: ::c_long,
pub f_bsize: ::c_long,
pub f_blocks: ::fsblkcnt64_t,
pub f_bfree: ::fsblkcnt64_t,
pub f_bavail: ::fsblkcnt64_t,
pub f_files: ::fsfilcnt64_t,
pub f_ffree: ::fsfilcnt64_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_long,
pub f_frsize: ::c_long,
pub f_flags: ::c_long,
pub f_spare: [::c_long; 4],
}

pub struct ipc_perm {
pub __key: ::key_t,
pub uid: ::uid_t,
Expand Down
30 changes: 0 additions & 30 deletions src/unix/linux_like/linux/musl/b64/mips64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,36 +54,6 @@ s! {
__pad5: [::c_int; 14],
}

pub struct statfs {
pub f_type: ::c_ulong,
pub f_bsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_flags: ::c_ulong,
pub f_spare: [::c_ulong; 5],
}

pub struct statfs64 {
pub f_type: ::c_ulong,
pub f_bsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_flags: ::c_ulong,
pub f_spare: [::c_ulong; 5],
}

pub struct ipc_perm {
pub __ipc_perm_key: ::key_t,
pub uid: ::uid_t,
Expand Down
30 changes: 0 additions & 30 deletions src/unix/linux_like/linux/musl/b64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,36 +44,6 @@ s! {
__pad2: ::c_ulong,
}

pub struct statfs {
pub f_type: ::c_ulong,
pub f_bsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_flags: ::c_ulong,
pub f_spare: [::c_ulong; 4],
}

pub struct statfs64 {
pub f_type: ::c_ulong,
pub f_bsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_flags: ::c_ulong,
pub f_spare: [::c_ulong; 4],
}

pub struct msghdr {
pub msg_name: *mut ::c_void,
pub msg_namelen: ::socklen_t,
Expand Down
32 changes: 0 additions & 32 deletions src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ pub type wchar_t = ::c_int;

pub type nlink_t = ::c_uint;
pub type blksize_t = ::c_int;
pub type fsblkcnt64_t = ::c_ulong;
pub type fsfilcnt64_t = ::c_ulong;
pub type __u64 = ::c_ulonglong;
pub type __s64 = ::c_longlong;

Expand Down Expand Up @@ -59,36 +57,6 @@ s! {
__unused: [::c_int; 2],
}

pub struct statfs {
pub f_type: ::c_long,
pub f_bsize: ::c_long,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_long,
pub f_frsize: ::c_long,
pub f_flags: ::c_long,
pub f_spare: [::c_long; 4],
}

pub struct statfs64 {
pub f_type: ::c_long,
pub f_bsize: ::c_long,
pub f_blocks: ::fsblkcnt64_t,
pub f_bfree: ::fsblkcnt64_t,
pub f_bavail: ::fsblkcnt64_t,
pub f_files: ::fsfilcnt64_t,
pub f_ffree: ::fsfilcnt64_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_long,
pub f_frsize: ::c_long,
pub f_flags: ::c_long,
pub f_spare: [::c_long; 4],
}

pub struct stack_t {
pub ss_sp: *mut ::c_void,
pub ss_flags: ::c_int,
Expand Down
30 changes: 0 additions & 30 deletions src/unix/linux_like/linux/musl/b64/s390x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,36 +58,6 @@ s! {
pub st_blocks: ::blkcnt64_t,
__unused: [::c_long; 3],
}

pub struct statfs {
pub f_type: ::c_uint,
pub f_bsize: ::c_uint,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_uint,
pub f_frsize: ::c_uint,
pub f_flags: ::c_uint,
pub f_spare: [::c_uint; 4],
}

pub struct statfs64 {
pub f_type: ::c_uint,
pub f_bsize: ::c_uint,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_uint,
pub f_frsize: ::c_uint,
pub f_flags: ::c_uint,
pub f_spare: [::c_uint; 4],
}
}

s_no_extra_traits! {
Expand Down
Loading

0 comments on commit ace85ee

Please sign in to comment.