diff --git a/libc-test/build.rs b/libc-test/build.rs index 1685d22bd0f2..4baaf684e184 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -343,6 +343,11 @@ fn main() { "setrlimit" | "setrlimit64" | // non-int in 1st arg "strerror_r" if linux => true, // actually xpg-something-or-other + // int vs uint. Sorry musl, your prototype declarations are "correct" in the sense that + // they match the interface defined by Linux verbatim, but they conflict with other + // send*/recv* syscalls + "sendmmsg" | "recvmmsg" if musl => true, + // typed 2nd arg on linux and android "gettimeofday" if linux || android || freebsd || openbsd || dragonfly => true, diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs index 81693382cdb5..3dd0a38c3162 100644 --- a/src/unix/notbsd/linux/mod.rs +++ b/src/unix/notbsd/linux/mod.rs @@ -181,6 +181,11 @@ s! { #[cfg(target_pointer_width = "64")] bits: [u64; 16], } + + pub struct mmsghdr { + pub msg_hdr: ::msghdr, + pub msg_len: ::c_uint, + } } pub const ABDAY_1: ::nl_item = 0x20000; @@ -617,6 +622,13 @@ extern { pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char; } +extern { + pub fn sendmmsg(sockfd: ::c_int, msgvec: *mut mmsghdr, vlen: ::c_uint, + flags: ::c_int) -> ::c_int; + pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut mmsghdr, vlen: ::c_uint, + flags: ::c_int, timeout: *mut ::timespec) -> ::c_int; +} + cfg_if! { if #[cfg(any(target_env = "musl", target_env = "musleabi",