@@ -31,7 +31,9 @@ pub use libc::c_int;
3131// Used in `Domain`.
3232pub ( crate ) use libc:: { AF_INET , AF_INET6 } ;
3333// Used in `Type`.
34- pub ( crate ) use libc:: { SOCK_DGRAM , SOCK_RAW , SOCK_SEQPACKET , SOCK_STREAM } ;
34+ #[ cfg( not( target_os = "redox" ) ) ]
35+ pub ( crate ) use libc:: SOCK_RAW ;
36+ pub ( crate ) use libc:: { SOCK_DGRAM , SOCK_SEQPACKET , SOCK_STREAM } ;
3537// Used in `Protocol`.
3638pub ( crate ) use libc:: { IPPROTO_ICMP , IPPROTO_ICMPV6 , IPPROTO_TCP , IPPROTO_UDP } ;
3739
@@ -131,8 +133,9 @@ impl_debug!(
131133 crate :: Type ,
132134 libc:: SOCK_STREAM ,
133135 libc:: SOCK_DGRAM ,
136+ #[ cfg( not( target_os = "redox" ) ) ]
134137 libc:: SOCK_RAW ,
135- #[ cfg( not( target_os = "haiku" ) ) ]
138+ #[ cfg( not( any ( target_os = "haiku" , target_os = "redox" ) ) ) ]
136139 libc:: SOCK_RDM ,
137140 libc:: SOCK_SEQPACKET ,
138141 /* TODO: add these optional bit OR-ed flags:
@@ -534,13 +537,15 @@ impl Socket {
534537 unsafe { self . setsockopt ( libc:: IPPROTO_IP , libc:: IP_TTL , ttl as c_int ) }
535538 }
536539
540+ #[ cfg( not( target_os = "redox" ) ) ]
537541 pub fn mss ( & self ) -> io:: Result < u32 > {
538542 unsafe {
539543 let raw: c_int = self . getsockopt ( libc:: IPPROTO_TCP , libc:: TCP_MAXSEG ) ?;
540544 Ok ( raw as u32 )
541545 }
542546 }
543547
548+ #[ cfg( not( target_os = "redox" ) ) ]
544549 pub fn set_mss ( & self , mss : u32 ) -> io:: Result < ( ) > {
545550 unsafe { self . setsockopt ( libc:: IPPROTO_TCP , libc:: TCP_MAXSEG , mss as c_int ) }
546551 }
0 commit comments