Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/backend/libc/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ pub(super) fn send_recv_len(len: usize) -> i32 {
/// Convert the return value of a `send` or `recv` call.
#[cfg(not(any(windows, target_os = "redox", target_os = "wasi")))]
#[inline]
pub(super) fn ret_send_recv(len: isize) -> io::Result<usize> {
pub(super) fn ret_send_recv(len: c::ssize_t) -> io::Result<usize> {
ret_usize(len)
}

Expand Down
16 changes: 9 additions & 7 deletions src/backend/libc/net/syscalls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use super::msghdr::with_xdp_msghdr;
#[cfg(target_os = "linux")]
use super::write_sockaddr::encode_sockaddr_xdp;
use crate::backend::c;
use crate::backend::conv::{borrowed_fd, ret, ret_owned_fd, ret_send_recv, send_recv_len};
use crate::backend::conv::{
borrowed_fd, ret, ret_owned_fd, ret_send_recv, ret_usize, send_recv_len,
};
use crate::fd::{BorrowedFd, OwnedFd};
use crate::io;
#[cfg(target_os = "linux")]
Expand Down Expand Up @@ -329,7 +331,7 @@ pub(crate) fn recvmsg(

with_recv_msghdr(&mut storage, iov, control, |msghdr| {
let result = unsafe {
ret_send_recv(c::recvmsg(
ret_usize(c::recvmsg(
borrowed_fd(sockfd),
msghdr,
bitflags_bits!(msg_flags),
Expand Down Expand Up @@ -364,7 +366,7 @@ pub(crate) fn sendmsg(
msg_flags: SendFlags,
) -> io::Result<usize> {
with_noaddr_msghdr(iov, control, |msghdr| unsafe {
ret_send_recv(c::sendmsg(
ret_usize(c::sendmsg(
borrowed_fd(sockfd),
&msghdr,
bitflags_bits!(msg_flags),
Expand All @@ -387,7 +389,7 @@ pub(crate) fn sendmsg_v4(
msg_flags: SendFlags,
) -> io::Result<usize> {
with_v4_msghdr(addr, iov, control, |msghdr| unsafe {
ret_send_recv(c::sendmsg(
ret_usize(c::sendmsg(
borrowed_fd(sockfd),
&msghdr,
bitflags_bits!(msg_flags),
Expand All @@ -410,7 +412,7 @@ pub(crate) fn sendmsg_v6(
msg_flags: SendFlags,
) -> io::Result<usize> {
with_v6_msghdr(addr, iov, control, |msghdr| unsafe {
ret_send_recv(c::sendmsg(
ret_usize(c::sendmsg(
borrowed_fd(sockfd),
&msghdr,
bitflags_bits!(msg_flags),
Expand All @@ -430,7 +432,7 @@ pub(crate) fn sendmsg_unix(
msg_flags: SendFlags,
) -> io::Result<usize> {
super::msghdr::with_unix_msghdr(addr, iov, control, |msghdr| unsafe {
ret_send_recv(c::sendmsg(
ret_usize(c::sendmsg(
borrowed_fd(sockfd),
&msghdr,
bitflags_bits!(msg_flags),
Expand All @@ -447,7 +449,7 @@ pub(crate) fn sendmsg_xdp(
msg_flags: SendFlags,
) -> io::Result<usize> {
with_xdp_msghdr(addr, iov, control, |msghdr| unsafe {
ret_send_recv(c::sendmsg(
ret_usize(c::sendmsg(
borrowed_fd(sockfd),
&msghdr,
bitflags_bits!(msg_flags),
Expand Down
Loading