Skip to content

Commit

Permalink
Merge #1372
Browse files Browse the repository at this point in the history
1372: Remove s390x exemptions from sys::statfs MAGIC constants r=asomers a=Jakob-Naucke

Since rust-lang/libc is now using the correct data type on s390x (c_uint) for
statfs constants, the s390x exemptions in the statfs MAGIC definitions like
EXT4_SUPER_MAGIC can be removed.

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>

Co-authored-by: Jakob Naucke <jakob.naucke@ibm.com>
  • Loading branch information
bors[bot] and Jakob-Naucke authored Feb 7, 2021
2 parents a279f78 + 6898024 commit e7c7021
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 30 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Added limited Fuchsia support (#[1285](https://github.com/nix-rust/nix/pull/1285))
- Added `getpeereid` (#[1342](https://github.com/nix-rust/nix/pull/1342))
### Fixed
- Define `*_MAGIC` filesystem constants on Linux s390x
(#[1372](https://github.com/nix-rust/nix/pull/1372))

### Changed

- Minimum supported Rust version is now 1.40.0.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ targets = [
]

[dependencies]
libc = { version = "0.2.78", features = [ "extra_traits" ] }
libc = { version = "0.2.82", features = [ "extra_traits" ] }
bitflags = "1.1"
cfg-if = "1.0"

Expand Down
58 changes: 29 additions & 29 deletions src/sys/statfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,63 +31,63 @@ pub struct FsType(pub libc::c_ulong);
#[derive(Eq, Copy, Clone, PartialEq, Debug)]
pub struct FsType(pub libc::c_long);

#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const ADFS_SUPER_MAGIC: FsType = FsType(libc::ADFS_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const AFFS_SUPER_MAGIC: FsType = FsType(libc::AFFS_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const CODA_SUPER_MAGIC: FsType = FsType(libc::CODA_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const CRAMFS_MAGIC: FsType = FsType(libc::CRAMFS_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const EFS_SUPER_MAGIC: FsType = FsType(libc::EFS_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const EXT2_SUPER_MAGIC: FsType = FsType(libc::EXT2_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const EXT3_SUPER_MAGIC: FsType = FsType(libc::EXT3_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const EXT4_SUPER_MAGIC: FsType = FsType(libc::EXT4_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const HPFS_SUPER_MAGIC: FsType = FsType(libc::HPFS_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const HUGETLBFS_MAGIC: FsType = FsType(libc::HUGETLBFS_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const ISOFS_SUPER_MAGIC: FsType = FsType(libc::ISOFS_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const JFFS2_SUPER_MAGIC: FsType = FsType(libc::JFFS2_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const MINIX_SUPER_MAGIC: FsType = FsType(libc::MINIX_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const MINIX_SUPER_MAGIC2: FsType = FsType(libc::MINIX_SUPER_MAGIC2);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const MINIX2_SUPER_MAGIC: FsType = FsType(libc::MINIX2_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const MINIX2_SUPER_MAGIC2: FsType = FsType(libc::MINIX2_SUPER_MAGIC2);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const MSDOS_SUPER_MAGIC: FsType = FsType(libc::MSDOS_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const NCP_SUPER_MAGIC: FsType = FsType(libc::NCP_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const NFS_SUPER_MAGIC: FsType = FsType(libc::NFS_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const OPENPROM_SUPER_MAGIC: FsType = FsType(libc::OPENPROM_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const OVERLAYFS_SUPER_MAGIC: FsType = FsType(libc::OVERLAYFS_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const PROC_SUPER_MAGIC: FsType = FsType(libc::PROC_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const QNX4_SUPER_MAGIC: FsType = FsType(libc::QNX4_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const REISERFS_SUPER_MAGIC: FsType = FsType(libc::REISERFS_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const SMB_SUPER_MAGIC: FsType = FsType(libc::SMB_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const TMPFS_MAGIC: FsType = FsType(libc::TMPFS_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const USBDEVICE_SUPER_MAGIC: FsType = FsType(libc::USBDEVICE_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const CGROUP_SUPER_MAGIC: FsType = FsType(libc::CGROUP_SUPER_MAGIC);
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub const CGROUP2_SUPER_MAGIC: FsType = FsType(libc::CGROUP2_SUPER_MAGIC);

impl Statfs {
Expand Down

0 comments on commit e7c7021

Please sign in to comment.