diff options
Diffstat (limited to 'src/sys')
-rw-r--r-- | src/sys/unix/selector/kqueue.rs | 6 | ||||
-rw-r--r-- | src/sys/unix/tcp.rs | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/sys/unix/selector/kqueue.rs b/src/sys/unix/selector/kqueue.rs index f509f92..34f5340 100644 --- a/src/sys/unix/selector/kqueue.rs +++ b/src/sys/unix/selector/kqueue.rs @@ -19,7 +19,7 @@ type Count = libc::c_int; type Count = libc::size_t; // Type of the `filter` field in the `kevent` structure. -#[cfg(any(target_os = "freebsd", target_os = "openbsd"))] +#[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd"))] type Filter = libc::c_short; #[cfg(any(target_os = "macos", target_os = "ios"))] type Filter = i16; @@ -27,7 +27,7 @@ type Filter = i16; type Filter = u32; // Type of the `flags` field in the `kevent` structure. -#[cfg(any(target_os = "freebsd", target_os = "openbsd"))] +#[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd"))] type Flags = libc::c_ushort; #[cfg(any(target_os = "macos", target_os = "ios"))] type Flags = u16; @@ -651,7 +651,7 @@ pub mod event { libc::NOTE_LEEWAY, #[cfg(any(target_os = "ios", target_os = "macos"))] libc::NOTE_CRITICAL, - #[cfg(any(target_os = "dragonfly"))] + #[cfg(any(target_os = "ios", target_os = "macos"))] libc::NOTE_BACKGROUND, ); 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, |