Skip to content

Commit

Permalink
agent: Fix type for PROC_SUPER_MAGIC on s390x
Browse files Browse the repository at this point in the history
statfs f_types are long on most architectures, but not on s390x, where
they are uint. Following the fix in rust-lang/libc at
rust-lang/libc#1999, the custom defined
PROC_SUPER_MAGIC must be updated in a similar way.

Fixes: #1204

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
  • Loading branch information
Jakob-Naucke committed Mar 29, 2021
1 parent 5b7c8b7 commit 52a276f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/agent/rustjail/src/mount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ const MOUNTINFOFORMAT: &str = "{d} {d} {d}:{d} {} {} {} {}";
const PROC_PATH: &str = "/proc";

// since libc didn't defined this const for musl, thus redefined it here.
#[cfg(all(target_os = "linux", target_env = "gnu"))]
#[cfg(all(target_os = "linux", target_env = "gnu", not(target_arch = "s390x")))]
const PROC_SUPER_MAGIC: libc::c_long = 0x00009fa0;
#[cfg(all(target_os = "linux", target_env = "musl"))]
const PROC_SUPER_MAGIC: libc::c_ulong = 0x00009fa0;
#[cfg(all(target_os = "linux", target_env = "gnu", target_arch = "s390x"))]
const PROC_SUPER_MAGIC: libc::c_uint = 0x00009fa0;

lazy_static! {
static ref PROPAGATION: HashMap<&'static str, MsFlags> = {
Expand Down

0 comments on commit 52a276f

Please sign in to comment.