summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-10-09 06:02:29 +0000
committerbors <bors@rust-lang.org>2022-10-09 06:02:29 +0000
commitf064e97b687b508e4adbaae9ef4c38e23662ad2b (patch)
tree420898ee69aca0c1ddec42eac3f2e47a875f5797
parentcfb68f43fa04fdb4f0364c1e00fca7f3a9c4daca (diff)
parentfcc0c72ecd5deeaac572d5f28469ee17964b5314 (diff)
downloadrust-libc-f064e97b687b508e4adbaae9ef4c38e23662ad2b.tar.gz
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
-rw-r--r--libc-test/semver/android.txt1
-rw-r--r--src/unix/linux_like/android/mod.rs11
2 files changed, 12 insertions, 0 deletions
diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt
index 62f96299c6..d5d9fc5600 100644
--- a/libc-test/semver/android.txt
+++ b/libc-test/semver/android.txt
@@ -2631,6 +2631,7 @@ WUNTRACED
W_EXITCODE
W_OK
W_STOPCODE
+XFS_SUPER_MAGIC
XTABS
X_OK
_IOFBF
diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs
index 8a21147def..67e5eb52b4 100644
--- a/src/unix/linux_like/android/mod.rs
+++ b/src/unix/linux_like/android/mod.rs
@@ -2709,6 +2709,17 @@ pub const RTMSG_DELDEVICE: u32 = 0x12;
pub const RTMSG_NEWROUTE: u32 = 0x21;
pub const RTMSG_DELROUTE: u32 = 0x22;
+// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the
+// following are only available on newer Linux versions than the versions
+// currently used in CI in some configurations, so we define them here.
+cfg_if! {
+ if #[cfg(not(target_arch = "s390x"))] {
+ pub const XFS_SUPER_MAGIC: ::c_long = 0x58465342;
+ } else if #[cfg(target_arch = "s390x")] {
+ pub const XFS_SUPER_MAGIC: ::c_uint = 0x58465342;
+ }
+}
+
f! {
pub fn CMSG_NXTHDR(mhdr: *const msghdr,
cmsg: *const cmsghdr) -> *mut cmsghdr {