From 52fa9bbf58d6c8a97fe5011356caaa42f84c3925 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 8 Jan 2018 00:13:59 +0100 Subject: [PATCH] make statfs/statvfs to be available wherever they are available libc reads sys/statvfs.h on all OS except Windows which nix doesn't care about. Closes: https://github.com/nix-rust/nix/issues/831 Signed-off-by: Igor Gnatenko --- src/sys/mod.rs | 15 ++------------- src/sys/statvfs.rs | 6 +++--- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/sys/mod.rs b/src/sys/mod.rs index a94b8a062f..8bdf3c24fb 100644 --- a/src/sys/mod.rs +++ b/src/sys/mod.rs @@ -62,20 +62,9 @@ pub mod select; #[cfg(target_os = "linux")] pub mod quota; - -#[cfg(all(target_os = "linux", - any(target_arch = "x86", - target_arch = "x86_64", - target_arch = "arm")), - )] +#[cfg(any(target_os = "android", target_os = "linux", target_os = "macos"))] pub mod statfs; - -#[cfg(all(any(target_os = "linux", - target_os = "macos"), - any(target_arch = "x86", - target_arch = "x86_64", - target_arch = "arm")), - )] pub mod statvfs; + pub mod pthread; diff --git a/src/sys/statvfs.rs b/src/sys/statvfs.rs index fbd0570eff..c1c66de557 100644 --- a/src/sys/statvfs.rs +++ b/src/sys/statvfs.rs @@ -32,13 +32,13 @@ libc_bitflags!( #[cfg(any(target_os = "android", target_os = "linux"))] ST_MANDLOCK; /// Write on file/directory/symlink - #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(target_os = "linux")] ST_WRITE; /// Append-only file - #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(target_os = "linux")] ST_APPEND; /// Immutable file - #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(target_os = "linux")] ST_IMMUTABLE; /// Do not update access times on files #[cfg(any(target_os = "android", target_os = "linux"))]