diff --git a/src/sys/socket/addr.rs b/src/sys/socket/addr.rs index 193f18b363..9d22beea58 100644 --- a/src/sys/socket/addr.rs +++ b/src/sys/socket/addr.rs @@ -1043,7 +1043,7 @@ pub trait SockaddrLike: private::SockaddrLikePriv { } /// Return the available space in the structure - fn space() -> libc::socklen_t where Self: Sized { + fn size() -> libc::socklen_t where Self: Sized { mem::size_of::() as libc::socklen_t } } @@ -1104,7 +1104,7 @@ impl SockaddrIn { target_os = "macos", target_os = "netbsd", target_os = "openbsd"))] - sin_len: Self::space() as u8, + sin_len: Self::size() as u8, sin_family: AddressFamily::Inet as sa_family_t, sin_port: u16::to_be(port), sin_addr: libc::in_addr { diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index 813df61081..f5004b4541 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -1661,7 +1661,7 @@ unsafe fn pack_mhdr_to_receive<'a, I, S>( let mut mhdr = mem::MaybeUninit::::zeroed(); let p = mhdr.as_mut_ptr(); (*p).msg_name = (*address).as_mut_ptr() as *mut c_void; - (*p).msg_namelen = S::space(); + (*p).msg_namelen = S::size(); (*p).msg_iov = iov.as_ref().as_ptr() as *mut iovec; (*p).msg_iovlen = iov.as_ref().len() as _; (*p).msg_control = msg_control as *mut c_void; @@ -2001,7 +2001,7 @@ pub fn setsockopt(fd: RawFd, opt: O, val: &O::Val) -> Result<()> pub fn getpeername(fd: RawFd) -> Result { unsafe { let mut addr = mem::MaybeUninit::::uninit(); - let mut len = T::space(); + let mut len = T::size(); let ret = libc::getpeername( fd, @@ -2022,7 +2022,7 @@ pub fn getpeername(fd: RawFd) -> Result { pub fn getsockname(fd: RawFd) -> Result { unsafe { let mut addr = mem::MaybeUninit::::uninit(); - let mut len = T::space(); + let mut len = T::size(); let ret = libc::getsockname( fd,