diff options
Diffstat (limited to 'src/sys/unix/tcp.rs')
-rw-r--r-- | src/sys/unix/tcp.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sys/unix/tcp.rs b/src/sys/unix/tcp.rs index 9e1d700..70986fa 100644 --- a/src/sys/unix/tcp.rs +++ b/src/sys/unix/tcp.rs @@ -140,6 +140,9 @@ pub(crate) fn set_linger(socket: TcpSocket, dur: Option<Duration>) -> io::Result syscall!(setsockopt( socket, libc::SOL_SOCKET, + #[cfg(target_vendor = "apple")] + libc::SO_LINGER_SEC, + #[cfg(not(target_vendor = "apple"))] libc::SO_LINGER, &val as *const libc::linger as *const libc::c_void, size_of::<libc::linger>() as libc::socklen_t, @@ -154,6 +157,9 @@ pub(crate) fn get_linger(socket: TcpSocket) -> io::Result<Option<Duration>> { syscall!(getsockopt( socket, libc::SOL_SOCKET, + #[cfg(target_vendor = "apple")] + libc::SO_LINGER_SEC, + #[cfg(not(target_vendor = "apple"))] libc::SO_LINGER, &mut val as *mut _ as *mut _, &mut len, |