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 Jun 4, 2023
1 parent c6f9e23 commit c04295a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
([#1964](https://github.com/nix-rust/nix/pull/1964))
- Fix: send ETH_P_ALL in htons format
([#1925](https://github.com/nix-rust/nix/pull/1925))
- Fix `statfs` compilation on s390x with musl libc.
([#1835](https://github.com/nix-rust/nix/pull/1835))

### Removed

Expand Down Expand Up @@ -119,7 +121,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
([#1824](https://github.com/nix-rust/nix/pull/1824))
- Workaround XNU bug causing netmasks returned by `getifaddrs` to misbehave.
([#1788](https://github.com/nix-rust/nix/pull/1788))

### Removed

- Removed deprecated error constants and conversions.
Expand Down
8 changes: 4 additions & 4 deletions src/sys/statfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,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 @@ -342,7 +342,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"))
))]
#[cfg_attr(docsrs, doc(cfg(all())))]
pub fn optimal_transfer_size(&self) -> libc::c_ulong {
Expand Down Expand Up @@ -401,7 +401,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")))]
#[cfg_attr(docsrs, doc(cfg(all())))]
pub fn block_size(&self) -> libc::c_ulong {
self.0.f_bsize
Expand Down Expand Up @@ -492,7 +492,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")))]
#[cfg_attr(docsrs, doc(cfg(all())))]
pub fn maximum_name_length(&self) -> libc::c_ulong {
self.0.f_namelen
Expand Down

0 comments on commit c04295a

Please sign in to comment.