Skip to content

Commit

Permalink
Auto merge of #2949 - MrCroxx:xx/android-xfs-super-magic, r=JohnTitor
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Oct 9, 2022
2 parents cfb68f4 + fcc0c72 commit f064e97
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions libc-test/semver/android.txt
Expand Up @@ -2631,6 +2631,7 @@ WUNTRACED
W_EXITCODE
W_OK
W_STOPCODE
XFS_SUPER_MAGIC
XTABS
X_OK
_IOFBF
Expand Down
11 changes: 11 additions & 0 deletions src/unix/linux_like/android/mod.rs
Expand Up @@ -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 {
Expand Down

0 comments on commit f064e97

Please sign in to comment.