Skip to content

Commit f064e97

Browse files
committed
Auto merge of #2949 - MrCroxx:xx/android-xfs-super-magic, r=JohnTitor
add xfs super magic to android targets `XFS_SUPER_MAGIC` is defined in libc for android, but is missing in rust libc. https://android.googlesource.com/platform/bionic/+/master/libc/include/sys/vfs.h#105 fix: #2948
2 parents cfb68f4 + fcc0c72 commit f064e97

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

libc-test/semver/android.txt

+1
Original file line numberDiff line numberDiff line change
@@ -2631,6 +2631,7 @@ WUNTRACED
26312631
W_EXITCODE
26322632
W_OK
26332633
W_STOPCODE
2634+
XFS_SUPER_MAGIC
26342635
XTABS
26352636
X_OK
26362637
_IOFBF

src/unix/linux_like/android/mod.rs

+11
Original file line numberDiff line numberDiff line change
@@ -2709,6 +2709,17 @@ pub const RTMSG_DELDEVICE: u32 = 0x12;
27092709
pub const RTMSG_NEWROUTE: u32 = 0x21;
27102710
pub const RTMSG_DELROUTE: u32 = 0x22;
27112711

2712+
// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the
2713+
// following are only available on newer Linux versions than the versions
2714+
// currently used in CI in some configurations, so we define them here.
2715+
cfg_if! {
2716+
if #[cfg(not(target_arch = "s390x"))] {
2717+
pub const XFS_SUPER_MAGIC: ::c_long = 0x58465342;
2718+
} else if #[cfg(target_arch = "s390x")] {
2719+
pub const XFS_SUPER_MAGIC: ::c_uint = 0x58465342;
2720+
}
2721+
}
2722+
27122723
f! {
27132724
pub fn CMSG_NXTHDR(mhdr: *const msghdr,
27142725
cmsg: *const cmsghdr) -> *mut cmsghdr {

0 commit comments

Comments
 (0)