Skip to content

Commit eeeab13

Browse files
committed
Add support for Haiku
1 parent 1e91530 commit eeeab13

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/ext.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ use socket;
2323
cfg_if! {
2424
if #[cfg(any(target_os = "dragonfly",
2525
target_os = "freebsd",
26+
target_os = "haiku",
2627
target_os = "ios",
2728
target_os = "macos",
2829
target_os = "netbsd",
@@ -667,7 +668,7 @@ impl<T: AsRawSocket> AsSock for T {
667668
cfg_if! {
668669
if #[cfg(any(target_os = "macos", target_os = "ios"))] {
669670
use libc::TCP_KEEPALIVE as KEEPALIVE_OPTION;
670-
} else if #[cfg(any(target_os = "openbsd", target_os = "netbsd"))] {
671+
} else if #[cfg(any(target_os = "haiku", target_os = "netbsd", target_os = "openbsd"))] {
671672
use libc::SO_KEEPALIVE as KEEPALIVE_OPTION;
672673
} else if #[cfg(unix)] {
673674
use libc::TCP_KEEPIDLE as KEEPALIVE_OPTION;

src/sys/unix/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::mem;
1414
use std::net::{TcpListener, TcpStream, UdpSocket};
1515
use std::os::unix::io::FromRawFd;
1616
use libc::{self, c_int};
17-
#[cfg(not(any(target_os = "solaris", target_os = "illumos", target_os = "emscripten")))]
17+
#[cfg(not(any(target_os = "emscripten", target_os = "haiku", target_os = "illumos", target_os = "solaris")))]
1818
use libc::{ioctl, FIOCLEX};
1919

2020
mod impls;
@@ -36,7 +36,7 @@ pub struct Socket {
3636
}
3737

3838
impl Socket {
39-
#[cfg(not(any(target_os = "solaris", target_os = "illumos", target_os = "emscripten")))]
39+
#[cfg(not(any(target_os = "emscripten", target_os = "haiku", target_os = "illumos", target_os = "solaris")))]
4040
pub fn new(family: c_int, ty: c_int) -> io::Result<Socket> {
4141
unsafe {
4242
// Linux >2.6.26 overloads the type argument to accept SOCK_CLOEXEC,
@@ -58,7 +58,7 @@ impl Socket {
5858

5959
// ioctl(FIOCLEX) is not supported by Solaris/illumos or emscripten,
6060
// use fcntl(FD_CLOEXEC) instead
61-
#[cfg(any(target_os = "solaris", target_os = "illumos", target_os = "emscripten"))]
61+
#[cfg(any(target_os = "emscripten", target_os = "haiku", target_os = "illumos", target_os = "solaris"))]
6262
pub fn new(family: c_int, ty: c_int) -> io::Result<Socket> {
6363
unsafe {
6464
let fd = try!(::cvt(libc::socket(family, ty, 0)));

0 commit comments

Comments
 (0)