Skip to content

Commit

Permalink
Merge #1187
Browse files Browse the repository at this point in the history
1187: Make FsType's raw type public r=asomers a=MikailBag

# Motivation
Currently, `FsType` API is limited. In fact, only operation is supports is comparison with one of well-known IDs.
But:
* This list is incomplete. For example, it misses cgroupfs and cgroup2fs.
* This approach doesn't work with custom FSs.

Co-authored-by: Mikail Bagishov <bagishov.mikail@yandex.ru>
  • Loading branch information
bors[bot] and MikailBag committed Feb 13, 2020
2 parents 44ece7c + 2c1351b commit 922d5ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -9,6 +9,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
where it's available, and clears the environment of all variables
via `std::env::vars` and `std::env::remove_var` on others.
(#[1185](https://github.com/nix-rust/nix/pull/1185))
- `FsType` inner value made public.
(#[1187](https://github.com/nix-rust/nix/pull/1187))
### Changed
### Fixed
### Removed
Expand Down
10 changes: 5 additions & 5 deletions src/sys/statfs.rs
Expand Up @@ -20,19 +20,19 @@ pub struct Statfs(libc::statfs);

#[cfg(target_os = "freebsd")]
#[derive(Eq, Copy, Clone, PartialEq, Debug)]
pub struct FsType(u32);
pub struct FsType(pub u32);
#[cfg(target_os = "android")]
#[derive(Eq, Copy, Clone, PartialEq, Debug)]
pub struct FsType(libc::c_ulong);
pub struct FsType(pub libc::c_ulong);
#[cfg(all(target_os = "linux", target_arch = "s390x"))]
#[derive(Eq, Copy, Clone, PartialEq, Debug)]
pub struct FsType(u32);
pub struct FsType(pub u32);
#[cfg(all(target_os = "linux", target_env = "musl"))]
#[derive(Eq, Copy, Clone, PartialEq, Debug)]
pub struct FsType(libc::c_ulong);
pub struct FsType(pub libc::c_ulong);
#[cfg(all(target_os = "linux", not(any(target_arch = "s390x", target_env = "musl"))))]
#[derive(Eq, Copy, Clone, PartialEq, Debug)]
pub struct FsType(libc::c_long);
pub struct FsType(pub libc::c_long);

#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
pub const ADFS_SUPER_MAGIC: FsType = FsType(libc::ADFS_SUPER_MAGIC);
Expand Down

0 comments on commit 922d5ee

Please sign in to comment.