Skip to content

Commit d0891d9

Browse files
committed
Move BINDERFS_SUPER_MAGIC and XFS_SUPER_MAGIC back into ABI-specific mods.
1 parent f7f0656 commit d0891d9

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

src/unix/linux_like/linux/gnu/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,19 @@ pub const O_ACCMODE: ::c_int = 3;
846846
pub const ST_RELATIME: ::c_ulong = 4096;
847847
pub const NI_MAXHOST: ::socklen_t = 1025;
848848

849+
// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the
850+
// following are only available on newer Linux versions than the versions
851+
// currently used in CI in some configurations, so we define them here.
852+
cfg_if! {
853+
if #[cfg(not(target_arch = "s390x"))] {
854+
pub const BINDERFS_SUPER_MAGIC: ::c_long = 0x6c6f6f70;
855+
pub const XFS_SUPER_MAGIC: ::c_long = 0x58465342;
856+
} else if #[cfg(target_arch = "s390x")] {
857+
pub const BINDERFS_SUPER_MAGIC: ::c_uint = 0x6c6f6f70;
858+
pub const XFS_SUPER_MAGIC: ::c_uint = 0x58465342;
859+
}
860+
}
861+
849862
pub const CPU_SETSIZE: ::c_int = 0x400;
850863

851864
pub const PTRACE_TRACEME: ::c_uint = 0;

src/unix/linux_like/linux/uclibc/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ pub const SIGEV_THREAD_ID: ::c_int = 4;
8787

8888
pub const AF_VSOCK: ::c_int = 40;
8989

90+
// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the
91+
// following are only available on newer Linux versions than the versions
92+
// currently used in CI in some configurations, so we define them here.
93+
pub const BINDERFS_SUPER_MAGIC: ::c_long = 0x6c6f6f70;
94+
pub const XFS_SUPER_MAGIC: ::c_long = 0x58465342;
95+
9096
pub const PTRACE_TRACEME: ::c_int = 0;
9197
pub const PTRACE_PEEKTEXT: ::c_int = 1;
9298
pub const PTRACE_PEEKDATA: ::c_int = 2;

src/unix/linux_like/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,6 @@ cfg_if! {
13711371
pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff;
13721372
pub const AFS_SUPER_MAGIC: ::c_long = 0x5346414f;
13731373
pub const AUTOFS_SUPER_MAGIC: ::c_long = 0x0187;
1374-
pub const BINDERFS_SUPER_MAGIC: ::c_long = 0x6c6f6f70;
13751374
pub const BPF_FS_MAGIC: ::c_long = 0xcafe4a11;
13761375
pub const BTRFS_SUPER_MAGIC: ::c_long = 0x9123683e;
13771376
pub const CGROUP2_SUPER_MAGIC: ::c_long = 0x63677270;
@@ -1420,13 +1419,11 @@ cfg_if! {
14201419
pub const UDF_SUPER_MAGIC: ::c_long = 0x15013346;
14211420
pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2;
14221421
pub const XENFS_SUPER_MAGIC: ::c_long = 0xabba1974;
1423-
pub const XFS_SUPER_MAGIC: ::c_long = 0x58465342;
14241422
} else if #[cfg(target_arch = "s390x")] {
14251423
pub const ADFS_SUPER_MAGIC: ::c_uint = 0x0000adf5;
14261424
pub const AFFS_SUPER_MAGIC: ::c_uint = 0x0000adff;
14271425
pub const AFS_SUPER_MAGIC: ::c_uint = 0x5346414f;
14281426
pub const AUTOFS_SUPER_MAGIC: ::c_uint = 0x0187;
1429-
pub const BINDERFS_SUPER_MAGIC: ::c_uint = 0x6c6f6f70;
14301427
pub const BPF_FS_MAGIC: ::c_uint = 0xcafe4a11;
14311428
pub const BTRFS_SUPER_MAGIC: ::c_uint = 0x9123683e;
14321429
pub const CGROUP2_SUPER_MAGIC: ::c_uint = 0x63677270;
@@ -1475,7 +1472,6 @@ cfg_if! {
14751472
pub const UDF_SUPER_MAGIC: ::c_uint = 0x15013346;
14761473
pub const USBDEVICE_SUPER_MAGIC: ::c_uint = 0x00009fa2;
14771474
pub const XENFS_SUPER_MAGIC: ::c_uint = 0xabba1974;
1478-
pub const XFS_SUPER_MAGIC: ::c_uint = 0x58465342;
14791475
}
14801476
}
14811477

0 commit comments

Comments
 (0)