summaryrefslogtreecommitdiffstats
path: root/vendor/libc/src/unix/linux_like/android/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--vendor/libc/src/unix/linux_like/android/mod.rs26
1 files changed, 20 insertions, 6 deletions
diff --git a/vendor/libc/src/unix/linux_like/android/mod.rs b/vendor/libc/src/unix/linux_like/android/mod.rs
index cfd229a47..67e5eb52b 100644
--- a/vendor/libc/src/unix/linux_like/android/mod.rs
+++ b/vendor/libc/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 {
@@ -2781,12 +2792,6 @@ f! {
pub fn minor(dev: ::dev_t) -> ::c_int {
((dev & 0xff) | ((dev >> 12) & 0xfff00)) as ::c_int
}
- pub fn makedev(ma: ::c_int, mi: ::c_int) -> ::dev_t {
- let ma = ma as ::dev_t;
- let mi = mi as ::dev_t;
- ((ma & 0xfff) << 8) | (mi & 0xff) | ((mi & 0xfff00) << 12)
- }
-
pub fn NLA_ALIGN(len: ::c_int) -> ::c_int {
return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1)
}
@@ -2796,6 +2801,15 @@ f! {
}
}
+safe_f! {
+ pub {const} fn makedev(ma: ::c_uint, mi: ::c_uint) -> ::dev_t {
+ let ma = ma as ::dev_t;
+ let mi = mi as ::dev_t;
+ ((ma & 0xfff) << 8) | (mi & 0xff) | ((mi & 0xfff00) << 12)
+ }
+
+}
+
extern "C" {
pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int;
pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int;