Skip to content

Commit 207fa1c

Browse files
committed
statfs: fixes for s390x+musl
1 parent 76f04df commit 207fa1c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
3333
([#1815](https://github.com/nix-rust/nix/pull/1815))
3434
- Fix `User::from_uid` and `User::from_name` crash on Android platform.
3535
([#1824](https://github.com/nix-rust/nix/pull/1824))
36+
- Fix `statfs` compilation on s390x with musl libc.
37+
([#1834](https://github.com/nix-rust/nix/pull/1834))
3638

3739
### Removed
3840

src/sys/statfs.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type fs_type_t = u32;
2929
type fs_type_t = libc::c_ulong;
3030
#[cfg(all(target_os = "linux", target_arch = "s390x"))]
3131
type fs_type_t = libc::c_uint;
32-
#[cfg(all(target_os = "linux", target_env = "musl"))]
32+
#[cfg(all(target_os = "linux", target_env = "musl", not(target_arch = "s390x")))]
3333
type fs_type_t = libc::c_ulong;
3434
#[cfg(all(target_os = "linux", target_env = "uclibc"))]
3535
type fs_type_t = libc::c_int;
@@ -255,7 +255,7 @@ impl Statfs {
255255
/// Optimal transfer block size
256256
#[cfg(any(
257257
target_os = "android",
258-
all(target_os = "linux", target_env = "musl")
258+
all(target_os = "linux", target_env = "musl", not(target_arch = "s390x"))
259259
))]
260260
#[cfg_attr(docsrs, doc(cfg(all())))]
261261
pub fn optimal_transfer_size(&self) -> libc::c_ulong {
@@ -307,7 +307,7 @@ impl Statfs {
307307

308308
/// Size of a block
309309
// f_bsize on linux: https://github.com/torvalds/linux/blob/master/fs/nfs/super.c#L471
310-
#[cfg(all(target_os = "linux", target_env = "musl"))]
310+
#[cfg(all(target_os = "linux", target_env = "musl", not(target_arch = "s390x")))]
311311
#[cfg_attr(docsrs, doc(cfg(all())))]
312312
pub fn block_size(&self) -> libc::c_ulong {
313313
self.0.f_bsize
@@ -365,7 +365,7 @@ impl Statfs {
365365
}
366366

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

0 commit comments

Comments
 (0)