Skip to content

Commit e7c7021

Browse files
Merge #1372
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 <[email protected]> Co-authored-by: Jakob Naucke <[email protected]>
2 parents a279f78 + 6898024 commit e7c7021

File tree

3 files changed

+33
-30
lines changed

3 files changed

+33
-30
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1010
- Added limited Fuchsia support (#[1285](https://github.com/nix-rust/nix/pull/1285))
1111
- Added `getpeereid` (#[1342](https://github.com/nix-rust/nix/pull/1342))
1212
### Fixed
13+
- Define `*_MAGIC` filesystem constants on Linux s390x
14+
(#[1372](https://github.com/nix-rust/nix/pull/1372))
15+
1316
### Changed
1417

1518
- Minimum supported Rust version is now 1.40.0.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ targets = [
3131
]
3232

3333
[dependencies]
34-
libc = { version = "0.2.78", features = [ "extra_traits" ] }
34+
libc = { version = "0.2.82", features = [ "extra_traits" ] }
3535
bitflags = "1.1"
3636
cfg-if = "1.0"
3737

src/sys/statfs.rs

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -31,63 +31,63 @@ pub struct FsType(pub libc::c_ulong);
3131
#[derive(Eq, Copy, Clone, PartialEq, Debug)]
3232
pub struct FsType(pub libc::c_long);
3333

34-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
34+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
3535
pub const ADFS_SUPER_MAGIC: FsType = FsType(libc::ADFS_SUPER_MAGIC);
36-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
36+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
3737
pub const AFFS_SUPER_MAGIC: FsType = FsType(libc::AFFS_SUPER_MAGIC);
38-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
38+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
3939
pub const CODA_SUPER_MAGIC: FsType = FsType(libc::CODA_SUPER_MAGIC);
40-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
40+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
4141
pub const CRAMFS_MAGIC: FsType = FsType(libc::CRAMFS_MAGIC);
42-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
42+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
4343
pub const EFS_SUPER_MAGIC: FsType = FsType(libc::EFS_SUPER_MAGIC);
44-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
44+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
4545
pub const EXT2_SUPER_MAGIC: FsType = FsType(libc::EXT2_SUPER_MAGIC);
46-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
46+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
4747
pub const EXT3_SUPER_MAGIC: FsType = FsType(libc::EXT3_SUPER_MAGIC);
48-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
48+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
4949
pub const EXT4_SUPER_MAGIC: FsType = FsType(libc::EXT4_SUPER_MAGIC);
50-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
50+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
5151
pub const HPFS_SUPER_MAGIC: FsType = FsType(libc::HPFS_SUPER_MAGIC);
52-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
52+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
5353
pub const HUGETLBFS_MAGIC: FsType = FsType(libc::HUGETLBFS_MAGIC);
54-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
54+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
5555
pub const ISOFS_SUPER_MAGIC: FsType = FsType(libc::ISOFS_SUPER_MAGIC);
56-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
56+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
5757
pub const JFFS2_SUPER_MAGIC: FsType = FsType(libc::JFFS2_SUPER_MAGIC);
58-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
58+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
5959
pub const MINIX_SUPER_MAGIC: FsType = FsType(libc::MINIX_SUPER_MAGIC);
60-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
60+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
6161
pub const MINIX_SUPER_MAGIC2: FsType = FsType(libc::MINIX_SUPER_MAGIC2);
62-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
62+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
6363
pub const MINIX2_SUPER_MAGIC: FsType = FsType(libc::MINIX2_SUPER_MAGIC);
64-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
64+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
6565
pub const MINIX2_SUPER_MAGIC2: FsType = FsType(libc::MINIX2_SUPER_MAGIC2);
66-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
66+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
6767
pub const MSDOS_SUPER_MAGIC: FsType = FsType(libc::MSDOS_SUPER_MAGIC);
68-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
68+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
6969
pub const NCP_SUPER_MAGIC: FsType = FsType(libc::NCP_SUPER_MAGIC);
70-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
70+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
7171
pub const NFS_SUPER_MAGIC: FsType = FsType(libc::NFS_SUPER_MAGIC);
72-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
72+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
7373
pub const OPENPROM_SUPER_MAGIC: FsType = FsType(libc::OPENPROM_SUPER_MAGIC);
74-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
74+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
7575
pub const OVERLAYFS_SUPER_MAGIC: FsType = FsType(libc::OVERLAYFS_SUPER_MAGIC);
76-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
76+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
7777
pub const PROC_SUPER_MAGIC: FsType = FsType(libc::PROC_SUPER_MAGIC);
78-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
78+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
7979
pub const QNX4_SUPER_MAGIC: FsType = FsType(libc::QNX4_SUPER_MAGIC);
80-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
80+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
8181
pub const REISERFS_SUPER_MAGIC: FsType = FsType(libc::REISERFS_SUPER_MAGIC);
82-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
82+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
8383
pub const SMB_SUPER_MAGIC: FsType = FsType(libc::SMB_SUPER_MAGIC);
84-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
84+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
8585
pub const TMPFS_MAGIC: FsType = FsType(libc::TMPFS_MAGIC);
86-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
86+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
8787
pub const USBDEVICE_SUPER_MAGIC: FsType = FsType(libc::USBDEVICE_SUPER_MAGIC);
88-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
88+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
8989
pub const CGROUP_SUPER_MAGIC: FsType = FsType(libc::CGROUP_SUPER_MAGIC);
90-
#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))]
90+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
9191
pub const CGROUP2_SUPER_MAGIC: FsType = FsType(libc::CGROUP2_SUPER_MAGIC);
9292

9393
impl Statfs {

0 commit comments

Comments
 (0)