diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 0d0eb3f3b0ff5..da144183ca368 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -135,6 +135,11 @@ s! { pub ss_size: ::size_t, pub ss_flags: ::c_int, } + + pub struct mmsghdr { + pub msg_hdr: ::msghdr, + pub msg_len: ::ssize_t, + } } s_no_extra_traits! { @@ -1205,6 +1210,11 @@ extern { pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int; pub fn __xuname(nmln: ::c_int, buf: *mut ::c_void) -> ::c_int; + + pub fn sendmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::size_t, + flags: ::c_int) -> ::ssize_t; + pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::size_t, + flags: ::c_int, timeout: *const ::timespec) -> ::ssize_t; } #[link(name = "util")] diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index 36a5366e6824c..28c0a6dcc79ee 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -268,6 +268,11 @@ s! { pub sdl_slen: ::uint8_t, pub sdl_data: [::c_char; 12], } + + pub struct mmsghdr { + pub msg_hdr: ::msghdr, + pub msg_len: ::c_uint, + } } s_no_extra_traits! { @@ -1238,6 +1243,11 @@ extern { pub fn settimeofday(tv: *const ::timeval, tz: *const ::c_void) -> ::c_int; pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int; + + 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; } #[link(name = "util")] diff --git a/src/unix/notbsd/android/mod.rs b/src/unix/notbsd/android/mod.rs index 2213b75b663ed..3fc03ade7318c 100644 --- a/src/unix/notbsd/android/mod.rs +++ b/src/unix/notbsd/android/mod.rs @@ -1950,6 +1950,10 @@ extern { f: extern fn(*mut ::c_void) -> *mut ::c_void, value: *mut ::c_void) -> ::c_int; pub fn __errno() -> *mut ::c_int; + pub fn sendmmsg(sockfd: ::c_int, msgvec: *const ::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: *const ::timespec) -> ::c_int; } cfg_if! { diff --git a/src/unix/notbsd/emscripten/mod.rs b/src/unix/notbsd/emscripten/mod.rs index 5de7b5ac57608..c084579da67e0 100644 --- a/src/unix/notbsd/emscripten/mod.rs +++ b/src/unix/notbsd/emscripten/mod.rs @@ -169,11 +169,6 @@ s! { pub msgseg: ::c_ushort, } - pub struct mmsghdr { - pub msg_hdr: ::msghdr, - pub msg_len: ::c_uint, - } - pub struct sembuf { pub sem_num: ::c_ushort, pub sem_op: ::c_short, @@ -1648,9 +1643,9 @@ extern { pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int; pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int; - pub fn sendmmsg(sockfd: ::c_int, msgvec: *mut mmsghdr, vlen: ::c_uint, + 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, + pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint, flags: ::c_int, timeout: *mut ::timespec) -> ::c_int; pub fn sync(); pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs index 03192e6278e3d..8abe76135d9a0 100644 --- a/src/unix/notbsd/linux/mod.rs +++ b/src/unix/notbsd/linux/mod.rs @@ -191,11 +191,6 @@ s! { pub msgseg: ::c_ushort, } - pub struct mmsghdr { - pub msg_hdr: ::msghdr, - pub msg_len: ::c_uint, - } - pub struct sembuf { pub sem_num: ::c_ushort, pub sem_op: ::c_short, @@ -2082,9 +2077,9 @@ extern { pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int; pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int; pub fn vhangup() -> ::c_int; - pub fn sendmmsg(sockfd: ::c_int, msgvec: *mut mmsghdr, vlen: ::c_uint, + 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, + pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint, flags: ::c_int, timeout: *mut ::timespec) -> ::c_int; pub fn sync(); pub fn syscall(num: ::c_long, ...) -> ::c_long; diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs index baabd6e84dadd..4394889256a4d 100644 --- a/src/unix/notbsd/mod.rs +++ b/src/unix/notbsd/mod.rs @@ -209,6 +209,11 @@ s! { pub ar_pln: u8, pub ar_op: u16, } + + pub struct mmsghdr { + pub msg_hdr: ::msghdr, + pub msg_len: ::c_uint, + } } s_no_extra_traits!{