From 138c85c4b119179b14d4e20508daa43e379d3919 Mon Sep 17 00:00:00 2001 From: Felix Obenhuber Date: Wed, 27 Apr 2022 13:02:42 +0200 Subject: [PATCH] fix: build for aarch64-linux-android With #77 nix provides statfs::CGROUP2_SUPER_MAGIC for the target_os "android". Fix the build build for `target_os = "android"` by adding this cfg setting to the "linux and not musl" impl of `is_cgroup2_unified_mode`. This patch depends opn #77 beeing merged. Signed-off-by: Felix Obenhuber --- src/hierarchies.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hierarchies.rs b/src/hierarchies.rs index ffe3a99..725a769 100644 --- a/src/hierarchies.rs +++ b/src/hierarchies.rs @@ -297,7 +297,10 @@ impl Default for V2 { pub const UNIFIED_MOUNTPOINT: &str = "/sys/fs/cgroup"; -#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[cfg(any( + all(target_os = "linux", not(target_env = "musl")), + target_os = "android" +))] pub fn is_cgroup2_unified_mode() -> bool { use nix::sys::statfs;