diff --git a/Cargo.toml b/Cargo.toml index 7258c62c..e2d49fe4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,13 +19,10 @@ all-features = true version = "0.3.3" features = ["handleapi", "ws2def", "ws2ipdef", "ws2tcpip", "minwindef"] -[target."cfg(any(unix, target_os = \"redox\"))".dependencies] +[target."cfg(unix)".dependencies] cfg-if = "1.0" libc = { version = "0.2.66", features = ["align"] } -[target."cfg(target_os = \"redox\")".dependencies] -redox_syscall = "0.1.38" - [dev-dependencies] tempdir = "0.3" diff --git a/src/socket.rs b/src/socket.rs index b8b48cfd..c69262ca 100644 --- a/src/socket.rs +++ b/src/socket.rs @@ -373,7 +373,7 @@ impl Socket { /// /// The `TCP_MAXSEG` option denotes the TCP Maximum Segment /// Size and is only available on TCP sockets. - #[cfg(unix)] + #[cfg(all(unix, not(target_os = "redox")))] pub fn mss(&self) -> io::Result { self.inner.mss() } @@ -382,7 +382,7 @@ impl Socket { /// /// The `TCP_MAXSEG` option denotes the TCP Maximum Segment /// Size and is only available on TCP sockets. - #[cfg(unix)] + #[cfg(all(unix, not(target_os = "redox")))] pub fn set_mss(&self, mss: u32) -> io::Result<()> { self.inner.set_mss(mss) } diff --git a/src/sys/unix.rs b/src/sys/unix.rs index 784187c5..5f3c27c9 100644 --- a/src/sys/unix.rs +++ b/src/sys/unix.rs @@ -31,7 +31,9 @@ pub use libc::c_int; // Used in `Domain`. pub(crate) use libc::{AF_INET, AF_INET6}; // Used in `Type`. -pub(crate) use libc::{SOCK_DGRAM, SOCK_RAW, SOCK_SEQPACKET, SOCK_STREAM}; +#[cfg(not(target_os = "redox"))] +pub(crate) use libc::SOCK_RAW; +pub(crate) use libc::{SOCK_DGRAM, SOCK_SEQPACKET, SOCK_STREAM}; // Used in `Protocol`. pub(crate) use libc::{IPPROTO_ICMP, IPPROTO_ICMPV6, IPPROTO_TCP, IPPROTO_UDP}; @@ -131,8 +133,9 @@ impl_debug!( crate::Type, libc::SOCK_STREAM, libc::SOCK_DGRAM, + #[cfg(not(target_os = "redox"))] libc::SOCK_RAW, - #[cfg(not(target_os = "haiku"))] + #[cfg(not(any(target_os = "haiku", target_os = "redox")))] libc::SOCK_RDM, libc::SOCK_SEQPACKET, /* TODO: add these optional bit OR-ed flags: @@ -534,6 +537,7 @@ impl Socket { unsafe { self.setsockopt(libc::IPPROTO_IP, libc::IP_TTL, ttl as c_int) } } + #[cfg(not(target_os = "redox"))] pub fn mss(&self) -> io::Result { unsafe { let raw: c_int = self.getsockopt(libc::IPPROTO_TCP, libc::TCP_MAXSEG)?; @@ -541,6 +545,7 @@ impl Socket { } } + #[cfg(not(target_os = "redox"))] pub fn set_mss(&self, mss: u32) -> io::Result<()> { unsafe { self.setsockopt(libc::IPPROTO_TCP, libc::TCP_MAXSEG, mss as c_int) } }