diff --git a/quinn-udp/src/unix.rs b/quinn-udp/src/unix.rs index 34def460e..a2e68623c 100644 --- a/quinn-udp/src/unix.rs +++ b/quinn-udp/src/unix.rs @@ -442,25 +442,9 @@ unsafe fn recvmmsg_with_fallback( let flags = 0; let timeout = ptr::null_mut::(); - #[cfg(not(any(target_os = "freebsd", target_os = "netbsd")))] - { - let ret = - libc::syscall(libc::SYS_recvmmsg, sockfd, msgvec, vlen, flags, timeout) as libc::c_int; - if ret != -1 { - return ret; - } - } - - // libc on FreeBSD and NetBSD implement `recvmmsg` as a high-level abstraction over - // `recvmsg`, thus `SYS_recvmmsg` constant and direct system call do not exist - #[cfg(any(target_os = "freebsd", target_os = "netbsd"))] - { - #[cfg(target_os = "freebsd")] - let vlen = vlen as usize; - let ret = libc::recvmmsg(sockfd, msgvec, vlen, flags, timeout) as libc::c_int; - if ret != -1 { - return ret; - } + let ret = libc::recvmmsg(sockfd, msgvec, vlen as _, flags, timeout) as libc::c_int; + if ret != -1 { + return ret; } let e = io::Error::last_os_error();