diff --git a/libc-test/build.rs b/libc-test/build.rs index 28ac5a51b97b..f855c8fe3a9a 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -404,6 +404,11 @@ fn main() { "prlimit" | "prlimit64" | // non-int in 2nd 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 3df6dabf09e9..382720789132 100644 --- a/src/unix/notbsd/linux/mod.rs +++ b/src/unix/notbsd/linux/mod.rs @@ -220,6 +220,11 @@ s! { pub msgtql: ::c_int, pub msgseg: ::c_ushort, } + + pub struct mmsghdr { + pub msg_hdr: ::msghdr, + pub msg_len: ::c_uint, + } } pub const ABDAY_1: ::nl_item = 0x20000; @@ -983,6 +988,13 @@ extern { -> ::ssize_t; } +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_os = "fuchsia",