Skip to content

Several fixes for Linux/musl/s390x #4549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions libc-test/semver/linux-gnu-s390x.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
sysctl
4 changes: 0 additions & 4 deletions libc-test/semver/linux-s390x.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ NFT_MSG_DELOBJ
NFT_MSG_GETOBJ
NFT_MSG_GETOBJ_RESET
NFT_MSG_NEWOBJ
PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
SIGSTKFLT
SIGUNUSED
SO_BSDCOMPAT
Expand Down Expand Up @@ -113,6 +110,5 @@ makecontext
mcontext_t
setcontext
swapcontext
sysctl
termios2
ucontext_t
17 changes: 17 additions & 0 deletions src/unix/linux_like/linux/musl/b64/s390x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pub type wchar_t = i32;
pub type greg_t = u64;
pub type __u64 = u64;
pub type __s64 = i64;
pub type statfs64 = statfs;

s! {
pub struct ipc_perm {
Expand Down Expand Up @@ -68,6 +69,21 @@ s! {
pub st_blocks: crate::blkcnt64_t,
__unused: [c_long; 3],
}

pub struct statfs {
pub f_type: c_uint,
pub f_bsize: c_uint,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: c_uint,
pub f_frsize: c_uint,
pub f_flags: c_uint,
pub f_spare: [c_uint; 4],
}
}

s_no_extra_traits! {
Expand Down Expand Up @@ -715,3 +731,4 @@ pub const SYS_futex_waitv: c_long = 449;
pub const SYS_set_mempolicy_home_node: c_long = 450;
pub const SYS_cachestat: c_long = 451;
pub const SYS_fchmodat2: c_long = 452;
pub const SYS_mseal: c_long = 462;
8 changes: 4 additions & 4 deletions src/unix/linux_like/linux/musl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ s! {
pub tcpi_snd_wnd: u32,
}

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

// MIPS implementation is special (see mips arch folders)
#[cfg(not(any(target_arch = "mips", target_arch = "mips64")))]
// MIPS/s390x implementation is special (see arch folders)
#[cfg(not(any(target_arch = "mips", target_arch = "mips64", target_arch = "s390x")))]
pub struct statfs64 {
pub f_type: c_ulong,
pub f_bsize: c_ulong,
Expand Down
Loading