diff --git a/src/ext.rs b/src/ext.rs index a0c5456..ca64bef 100644 --- a/src/ext.rs +++ b/src/ext.rs @@ -23,6 +23,7 @@ use socket; cfg_if! { if #[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "haiku", target_os = "ios", target_os = "macos", target_os = "netbsd", @@ -667,7 +668,7 @@ impl AsSock for T { cfg_if! { if #[cfg(any(target_os = "macos", target_os = "ios"))] { use libc::TCP_KEEPALIVE as KEEPALIVE_OPTION; - } else if #[cfg(any(target_os = "openbsd", target_os = "netbsd"))] { + } else if #[cfg(any(target_os = "haiku", target_os = "netbsd", target_os = "openbsd"))] { use libc::SO_KEEPALIVE as KEEPALIVE_OPTION; } else if #[cfg(unix)] { use libc::TCP_KEEPIDLE as KEEPALIVE_OPTION; diff --git a/src/sys/unix/mod.rs b/src/sys/unix/mod.rs index 3351356..cc8a60d 100644 --- a/src/sys/unix/mod.rs +++ b/src/sys/unix/mod.rs @@ -14,7 +14,7 @@ use std::mem; use std::net::{TcpListener, TcpStream, UdpSocket}; use std::os::unix::io::FromRawFd; use libc::{self, c_int}; -#[cfg(not(any(target_os = "solaris", target_os = "illumos", target_os = "emscripten")))] +#[cfg(not(any(target_os = "emscripten", target_os = "haiku", target_os = "illumos", target_os = "solaris")))] use libc::{ioctl, FIOCLEX}; mod impls; @@ -36,7 +36,7 @@ pub struct Socket { } impl Socket { - #[cfg(not(any(target_os = "solaris", target_os = "illumos", target_os = "emscripten")))] + #[cfg(not(any(target_os = "emscripten", target_os = "haiku", target_os = "illumos", target_os = "solaris")))] pub fn new(family: c_int, ty: c_int) -> io::Result { unsafe { // Linux >2.6.26 overloads the type argument to accept SOCK_CLOEXEC, @@ -58,7 +58,7 @@ impl Socket { // ioctl(FIOCLEX) is not supported by Solaris/illumos or emscripten, // use fcntl(FD_CLOEXEC) instead - #[cfg(any(target_os = "solaris", target_os = "illumos", target_os = "emscripten"))] + #[cfg(any(target_os = "emscripten", target_os = "haiku", target_os = "illumos", target_os = "solaris"))] pub fn new(family: c_int, ty: c_int) -> io::Result { unsafe { let fd = try!(::cvt(libc::socket(family, ty, 0)));