Skip to content

Commit

Permalink
statfs: fixes for s390x+musl
Browse files Browse the repository at this point in the history
  • Loading branch information
selfisekai committed Dec 15, 2023
1 parent 7c3d84b commit 158e65b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sys/statfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type fs_type_t = u32;
type fs_type_t = libc::c_ulong;
#[cfg(all(target_os = "linux", target_arch = "s390x"))]
type fs_type_t = libc::c_uint;
#[cfg(all(target_os = "linux", target_env = "musl"))]
#[cfg(all(target_os = "linux", target_env = "musl", not(target_arch = "s390x")))]
type fs_type_t = libc::c_ulong;
#[cfg(all(target_os = "linux", target_env = "uclibc"))]
type fs_type_t = libc::c_int;
Expand Down Expand Up @@ -322,7 +322,7 @@ impl Statfs {
/// Optimal transfer block size
#[cfg(any(
target_os = "android",
all(target_os = "linux", target_env = "musl")
all(target_os = "linux", target_env = "musl", not(target_arch = "s390x"))
))]
pub fn optimal_transfer_size(&self) -> libc::c_ulong {
self.0.f_bsize
Expand Down Expand Up @@ -374,7 +374,7 @@ impl Statfs {

/// Size of a block
// f_bsize on linux: https://github.com/torvalds/linux/blob/master/fs/nfs/super.c#L471
#[cfg(all(target_os = "linux", target_env = "musl"))]
#[cfg(all(target_os = "linux", target_env = "musl", not(target_arch = "s390x")))]
pub fn block_size(&self) -> libc::c_ulong {
self.0.f_bsize
}
Expand Down Expand Up @@ -446,7 +446,7 @@ impl Statfs {
}

/// Maximum length of filenames
#[cfg(all(target_os = "linux", target_env = "musl"))]
#[cfg(all(target_os = "linux", target_env = "musl", not(target_arch = "s390x")))]
pub fn maximum_name_length(&self) -> libc::c_ulong {
self.0.f_namelen
}
Expand Down

0 comments on commit 158e65b

Please sign in to comment.