Skip to content

Commit

Permalink
Fix compilation on platforms without SO_RCVBUFFORCE.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Oct 17, 2024
1 parent 04bfd8b commit cb8766a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/backend/libc/net/sockopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ pub(crate) fn set_socket_recv_buffer_size(fd: BorrowedFd<'_>, size: usize) -> io
setsockopt(fd, c::SOL_SOCKET, c::SO_RCVBUF, size)
}

#[cfg(any(linux_kernel, target_os = "fuchsia", target_os = "redox"))]
#[inline]
pub(crate) fn set_socket_recv_buffer_size_force(fd: BorrowedFd<'_>, size: usize) -> io::Result<()> {
let size: c::c_int = size.try_into().map_err(|_| io::Errno::INVAL)?;
Expand Down
1 change: 1 addition & 0 deletions src/net/sockopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ pub fn set_socket_recv_buffer_size<Fd: AsFd>(fd: Fd, value: usize) -> io::Result
/// See the [module-level documentation] for more.
///
/// [module-level documentation]: self#references-for-get_socket_-and-set_socket_-functions
#[cfg(any(linux_kernel, target_os = "fuchsia", target_os = "redox"))]
#[inline]
#[doc(alias = "SO_RCVBUFFORCE")]
pub fn set_socket_recv_buffer_size_force<Fd: AsFd>(fd: Fd, value: usize) -> io::Result<()> {
Expand Down

0 comments on commit cb8766a

Please sign in to comment.