From 126cca278b51e331dcfde9d504850193438f698b Mon Sep 17 00:00:00 2001 From: Nicolas Dusart Date: Mon, 17 Jul 2017 09:39:23 +0200 Subject: [PATCH] WIP: add socket constants already present in libc --- src/sys/socket/sockopt.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/sys/socket/sockopt.rs b/src/sys/socket/sockopt.rs index 4cc82b6297..792bcb00fd 100644 --- a/src/sys/socket/sockopt.rs +++ b/src/sys/socket/sockopt.rs @@ -166,14 +166,11 @@ sockopt_impl!(Both, TcpKeepAlive, libc::IPPROTO_TCP, libc::TCP_KEEPALIVE, u32); sockopt_impl!(Both, TcpKeepIdle, libc::IPPROTO_TCP, libc::TCP_KEEPIDLE, u32); sockopt_impl!(Both, RcvBuf, libc::SOL_SOCKET, libc::SO_RCVBUF, usize); sockopt_impl!(Both, SndBuf, libc::SOL_SOCKET, libc::SO_SNDBUF, usize); -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "linux", target_os = "android"))] sockopt_impl!(SetOnly, RcvBufForce, libc::SOL_SOCKET, libc::SO_RCVBUFFORCE, usize); -#[cfg(all(target_os = "linux", not(target_arch="arm")))] +#[cfg(any(target_os = "linux", target_os = "android"))] sockopt_impl!(SetOnly, SndBufForce, libc::SOL_SOCKET, libc::SO_SNDBUFFORCE, usize); sockopt_impl!(GetOnly, SockType, libc::SOL_SOCKET, libc::SO_TYPE, super::SockType); -#[cfg(any(target_os = "freebsd", - target_os = "linux", - target_os = "nacl"))] sockopt_impl!(GetOnly, AcceptConn, libc::SOL_SOCKET, libc::SO_ACCEPTCONN, bool); #[cfg(any(target_os = "linux", target_os = "android"))] sockopt_impl!(GetOnly, OriginalDst, libc::SOL_IP, libc::SO_ORIGINAL_DST, sockaddr_in);