diff options
author | Alan Somers <asomers@gmail.com> | 2021-07-24 16:10:28 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-24 16:10:28 -0600 |
commit | 7fd7f27b2ef870ac20dff3d3e23fd32eecb4615f (patch) | |
tree | 1e1c90155e1c84ad3f2f3929059e3b9513ea00d5 /src/sys | |
parent | 7de40a921a493643727709596d14c2f2187166b8 (diff) | |
parent | 7033d470d000a35236f157258c13dd50bc64725a (diff) | |
download | nix-7fd7f27b2ef870ac20dff3d3e23fd32eecb4615f.zip |
Merge branch 'master' into const_timespec
Diffstat (limited to 'src/sys')
-rw-r--r-- | src/sys/select.rs | 10 | ||||
-rw-r--r-- | src/sys/socket/sockopt.rs | 1 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/sys/select.rs b/src/sys/select.rs index 5eb64234..a8035f79 100644 --- a/src/sys/select.rs +++ b/src/sys/select.rs @@ -32,8 +32,8 @@ impl FdSet { unsafe { libc::FD_CLR(fd, &mut self.0) }; } - pub fn contains(&mut self, fd: RawFd) -> bool { - unsafe { libc::FD_ISSET(fd, &mut self.0) } + pub fn contains(&self, fd: RawFd) -> bool { + unsafe { libc::FD_ISSET(fd, &self.0) } } pub fn clear(&mut self) { @@ -57,7 +57,7 @@ impl FdSet { /// ``` /// /// [`select`]: fn.select.html - pub fn highest(&mut self) -> Option<RawFd> { + pub fn highest(&self) -> Option<RawFd> { self.fds(None).next_back() } @@ -79,7 +79,7 @@ impl FdSet { /// assert_eq!(fds, vec![4, 9]); /// ``` #[inline] - pub fn fds(&mut self, highest: Option<RawFd>) -> Fds { + pub fn fds(&self, highest: Option<RawFd>) -> Fds { Fds { set: self, range: 0..highest.map(|h| h as usize + 1).unwrap_or(FD_SETSIZE), @@ -96,7 +96,7 @@ impl Default for FdSet { /// Iterator over `FdSet`. #[derive(Debug)] pub struct Fds<'a> { - set: &'a mut FdSet, + set: &'a FdSet, range: Range<usize>, } diff --git a/src/sys/socket/sockopt.rs b/src/sys/socket/sockopt.rs index e2f2cafe..69fe479a 100644 --- a/src/sys/socket/sockopt.rs +++ b/src/sys/socket/sockopt.rs @@ -330,6 +330,7 @@ sockopt_impl!(Both, UdpGsoSegment, libc::SOL_UDP, libc::UDP_SEGMENT, libc::c_int sockopt_impl!(Both, UdpGroSegment, libc::IPPROTO_UDP, libc::UDP_GRO, bool); #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] sockopt_impl!(Both, RxqOvfl, libc::SOL_SOCKET, libc::SO_RXQ_OVFL, libc::c_int); +sockopt_impl!(Both, Ipv6V6Only, libc::IPPROTO_IPV6, libc::IPV6_V6ONLY, bool); #[cfg(any(target_os = "android", target_os = "linux"))] #[derive(Copy, Clone, Debug)] |