Skip to content

Commit

Permalink
WIP: add socket constants already present in libc
Browse files Browse the repository at this point in the history
  • Loading branch information
ndusart committed Jul 17, 2017
1 parent a29c9d7 commit 126cca2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/sys/socket/sockopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 126cca2

Please sign in to comment.