Skip to content

Commit

Permalink
switch also the default implementation for read_vectored
Browse files Browse the repository at this point in the history
  • Loading branch information
stlankes committed May 20, 2024
1 parent c170bf9 commit d39dc0a
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions library/std/src/sys/pal/hermit/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,23 +175,12 @@ impl Socket {
}

pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
let mut size: isize = 0;

for i in bufs.iter_mut() {
let ret: isize =
cvt(unsafe { netc::read(self.0.as_raw_fd(), i.as_mut_ptr(), i.len()) })?;

if ret != 0 {
size += ret;
}
}

Ok(size.try_into().unwrap())
crate::io::default_read_vectored(|b| self.read(b), bufs)
}

#[inline]
pub fn is_read_vectored(&self) -> bool {
true
false
}

fn recv_from_with_flags(&self, buf: &mut [u8], flags: i32) -> io::Result<(usize, SocketAddr)> {
Expand Down

0 comments on commit d39dc0a

Please sign in to comment.