Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c04295a

Browse files
committedJun 4, 2023
statfs: fixes for s390x+musl
1 parent c6f9e23 commit c04295a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed
 

‎CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
4040
([#1964](https://github.com/nix-rust/nix/pull/1964))
4141
- Fix: send ETH_P_ALL in htons format
4242
([#1925](https://github.com/nix-rust/nix/pull/1925))
43+
- Fix `statfs` compilation on s390x with musl libc.
44+
([#1835](https://github.com/nix-rust/nix/pull/1835))
4345

4446
### Removed
4547

@@ -119,7 +121,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
119121
([#1824](https://github.com/nix-rust/nix/pull/1824))
120122
- Workaround XNU bug causing netmasks returned by `getifaddrs` to misbehave.
121123
([#1788](https://github.com/nix-rust/nix/pull/1788))
122-
124+
123125
### Removed
124126

125127
- Removed deprecated error constants and conversions.

‎src/sys/statfs.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ type fs_type_t = u32;
6464
type fs_type_t = libc::c_ulong;
6565
#[cfg(all(target_os = "linux", target_arch = "s390x"))]
6666
type fs_type_t = libc::c_uint;
67-
#[cfg(all(target_os = "linux", target_env = "musl"))]
67+
#[cfg(all(target_os = "linux", target_env = "musl", not(target_arch = "s390x")))]
6868
type fs_type_t = libc::c_ulong;
6969
#[cfg(all(target_os = "linux", target_env = "uclibc"))]
7070
type fs_type_t = libc::c_int;
@@ -342,7 +342,7 @@ impl Statfs {
342342
/// Optimal transfer block size
343343
#[cfg(any(
344344
target_os = "android",
345-
all(target_os = "linux", target_env = "musl")
345+
all(target_os = "linux", target_env = "musl", not(target_arch = "s390x"))
346346
))]
347347
#[cfg_attr(docsrs, doc(cfg(all())))]
348348
pub fn optimal_transfer_size(&self) -> libc::c_ulong {
@@ -401,7 +401,7 @@ impl Statfs {
401401

402402
/// Size of a block
403403
// f_bsize on linux: https://github.com/torvalds/linux/blob/master/fs/nfs/super.c#L471
404-
#[cfg(all(target_os = "linux", target_env = "musl"))]
404+
#[cfg(all(target_os = "linux", target_env = "musl", not(target_arch = "s390x")))]
405405
#[cfg_attr(docsrs, doc(cfg(all())))]
406406
pub fn block_size(&self) -> libc::c_ulong {
407407
self.0.f_bsize
@@ -492,7 +492,7 @@ impl Statfs {
492492
}
493493

494494
/// Maximum length of filenames
495-
#[cfg(all(target_os = "linux", target_env = "musl"))]
495+
#[cfg(all(target_os = "linux", target_env = "musl", not(target_arch = "s390x")))]
496496
#[cfg_attr(docsrs, doc(cfg(all())))]
497497
pub fn maximum_name_length(&self) -> libc::c_ulong {
498498
self.0.f_namelen

0 commit comments

Comments
 (0)
Please sign in to comment.