Skip to content

Commit 4db6d73

Browse files
mati865tgross35
authored andcommitted
musl: Add *_SUPER_MAGIC constants
IIUC, they were not added as part of #2639 because Musl kernel headers were too old.
1 parent 86216b9 commit 4db6d73

3 files changed

Lines changed: 14 additions & 19 deletions

File tree

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -767,19 +767,6 @@ pub const O_ACCMODE: c_int = 3;
767767
pub const ST_RELATIME: c_ulong = 4096;
768768
pub const NI_MAXHOST: crate::socklen_t = 1025;
769769

770-
// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the
771-
// following are only available on newer Linux versions than the versions
772-
// currently used in CI in some configurations, so we define them here.
773-
cfg_if! {
774-
if #[cfg(not(target_arch = "s390x"))] {
775-
pub const BINDERFS_SUPER_MAGIC: c_long = 0x6c6f6f70;
776-
pub const XFS_SUPER_MAGIC: c_long = 0x58465342;
777-
} else if #[cfg(target_arch = "s390x")] {
778-
pub const BINDERFS_SUPER_MAGIC: c_uint = 0x6c6f6f70;
779-
pub const XFS_SUPER_MAGIC: c_uint = 0x58465342;
780-
}
781-
}
782-
783770
pub const CPU_SETSIZE: c_int = 0x400;
784771

785772
pub const PTRACE_TRACEME: c_uint = 0;

src/unix/linux_like/linux/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2558,6 +2558,20 @@ pub const IN_ONLYDIR: u32 = 0x0100_0000;
25582558
pub const IN_DONT_FOLLOW: u32 = 0x0200_0000;
25592559
pub const IN_EXCL_UNLINK: u32 = 0x0400_0000;
25602560

2561+
// uapi/linux/magic.h
2562+
// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the
2563+
// following are only available on newer Linux versions than the versions
2564+
// currently used in CI in some configurations, so we define them here.
2565+
cfg_if! {
2566+
if #[cfg(not(target_arch = "s390x"))] {
2567+
pub const BINDERFS_SUPER_MAGIC: c_long = 0x6c6f6f70;
2568+
pub const XFS_SUPER_MAGIC: c_long = 0x58465342;
2569+
} else if #[cfg(target_arch = "s390x")] {
2570+
pub const BINDERFS_SUPER_MAGIC: c_uint = 0x6c6f6f70;
2571+
pub const XFS_SUPER_MAGIC: c_uint = 0x58465342;
2572+
}
2573+
}
2574+
25612575
// uapi/linux/securebits.h
25622576
const SECURE_NOROOT: c_int = 0;
25632577
const SECURE_NOROOT_LOCKED: c_int = 1;

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,6 @@ pub const MCL_ONFAULT: c_int = 0x0004;
229229

230230
pub const AF_VSOCK: c_int = 40;
231231

232-
// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the
233-
// following are only available on newer Linux versions than the versions
234-
// currently used in CI in some configurations, so we define them here.
235-
pub const BINDERFS_SUPER_MAGIC: c_long = 0x6c6f6f70;
236-
pub const XFS_SUPER_MAGIC: c_long = 0x58465342;
237-
238232
pub const PTRACE_TRACEME: c_int = 0;
239233
pub const PTRACE_PEEKTEXT: c_int = 1;
240234
pub const PTRACE_PEEKDATA: c_int = 2;

0 commit comments

Comments
 (0)