Skip to content

Commit

Permalink
make statfs/statvfs to be available wherever they are available
Browse files Browse the repository at this point in the history
libc reads sys/statvfs.h on all OS except Windows which nix doesn't care
about.

Closes: #831
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
  • Loading branch information
ignatenkobrain committed Jan 28, 2018
1 parent 899eff7 commit 32a5df2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Changed

### Fixed
- Fix `statvfs` module to be available on all supported platforms.
([#832](https://github.com/nix-rust/nix/pull/832))

### Removed

Expand Down
15 changes: 2 additions & 13 deletions src/sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
6 changes: 3 additions & 3 deletions src/sys/statvfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))]
Expand Down

0 comments on commit 32a5df2

Please sign in to comment.