Skip to content

Commit d4d4c3a

Browse files
committed
linux-musl: Specialize struct statfs[64] for s390x
https://git.musl-libc.org/cgit/musl/tree/arch/s390x/bits/statfs.h statfs64 is the same as statfs on musl-libc, so it can also be a type alias on the Rust side. https://git.musl-libc.org/cgit/musl/tree/include/sys/statfs.h#n21
1 parent 9e26bd8 commit d4d4c3a

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

src/unix/linux_like/linux/musl/b64/s390x.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pub type wchar_t = i32;
77
pub type greg_t = u64;
88
pub type __u64 = u64;
99
pub type __s64 = i64;
10+
pub type statfs64 = statfs;
1011

1112
s! {
1213
pub struct ipc_perm {
@@ -68,6 +69,21 @@ s! {
6869
pub st_blocks: crate::blkcnt64_t,
6970
__unused: [c_long; 3],
7071
}
72+
73+
pub struct statfs {
74+
pub f_type: c_uint,
75+
pub f_bsize: c_uint,
76+
pub f_blocks: crate::fsblkcnt_t,
77+
pub f_bfree: crate::fsblkcnt_t,
78+
pub f_bavail: crate::fsblkcnt_t,
79+
pub f_files: crate::fsfilcnt_t,
80+
pub f_ffree: crate::fsfilcnt_t,
81+
pub f_fsid: crate::fsid_t,
82+
pub f_namelen: c_uint,
83+
pub f_frsize: c_uint,
84+
pub f_flags: c_uint,
85+
pub f_spare: [c_uint; 4],
86+
}
7187
}
7288

7389
s_no_extra_traits! {

src/unix/linux_like/linux/musl/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,8 @@ s! {
372372
pub tcpi_snd_wnd: u32,
373373
}
374374

375-
// MIPS implementation is special (see mips arch folders)
376-
#[cfg(not(any(target_arch = "mips", target_arch = "mips64")))]
375+
// MIPS/s390x implementation is special (see arch folders)
376+
#[cfg(not(any(target_arch = "mips", target_arch = "mips64", target_arch = "s390x")))]
377377
pub struct statfs {
378378
pub f_type: c_ulong,
379379
pub f_bsize: c_ulong,
@@ -389,8 +389,8 @@ s! {
389389
pub f_spare: [c_ulong; 4],
390390
}
391391

392-
// MIPS implementation is special (see mips arch folders)
393-
#[cfg(not(any(target_arch = "mips", target_arch = "mips64")))]
392+
// MIPS/s390x implementation is special (see arch folders)
393+
#[cfg(not(any(target_arch = "mips", target_arch = "mips64", target_arch = "s390x")))]
394394
pub struct statfs64 {
395395
pub f_type: c_ulong,
396396
pub f_bsize: c_ulong,

0 commit comments

Comments
 (0)