Skip to content

Commit 24f41cb

Browse files
committed
Add support for illumos target
1 parent 3350e38 commit 24f41cb

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/ext.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ cfg_if! {
2828
target_os = "netbsd",
2929
target_os = "openbsd",
3030
target_os = "solaris",
31+
target_os = "illumos",
3132
target_env = "uclibc"))] {
3233
use libc::IPV6_JOIN_GROUP as IPV6_ADD_MEMBERSHIP;
3334
use libc::IPV6_LEAVE_GROUP as IPV6_DROP_MEMBERSHIP;

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ mod utils;
6868
#[cfg(unix)] #[path = "sys/unix/mod.rs"] mod sys;
6969
#[cfg(windows)] #[path = "sys/windows/mod.rs"] mod sys;
7070
#[cfg(target_os = "wasi")] #[path = "sys/wasi/mod.rs"] mod sys;
71-
#[cfg(all(unix, not(any(target_os = "solaris"))))] pub mod unix;
71+
#[cfg(all(unix, not(any(target_os = "solaris", target_os = "illumos"))))] pub mod unix;
7272

7373
pub use tcp::TcpBuilder;
7474
pub use udp::UdpBuilder;

src/sys/unix/mod.rs

Lines changed: 4 additions & 4 deletions
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 = "emscripten")))]
17+
#[cfg(not(any(target_os = "solaris", target_os = "illumos", target_os = "emscripten")))]
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 = "emscripten")))]
39+
#[cfg(not(any(target_os = "solaris", target_os = "illumos", target_os = "emscripten")))]
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,
@@ -56,9 +56,9 @@ impl Socket {
5656
}
5757
}
5858

59-
// ioctl(FIOCLEX) is not supported by Solaris/Illumos or emscripten,
59+
// ioctl(FIOCLEX) is not supported by Solaris/illumos or emscripten,
6060
// use fcntl(FD_CLOEXEC) instead
61-
#[cfg(any(target_os = "solaris", target_os = "emscripten"))]
61+
#[cfg(any(target_os = "solaris", target_os = "illumos", target_os = "emscripten"))]
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)