diff options
| author | Stefan Lankes <slankes@eonerc.rwth-aachen.de> | 2024-05-20 19:18:58 +0200 |
|---|---|---|
| committer | Stefan Lankes <slankes@eonerc.rwth-aachen.de> | 2024-05-20 19:24:11 +0200 |
| commit | c170bf99273ce194b7d4cf71abb946fe47d58f82 (patch) | |
| tree | 3edcff99641b6fd2afe5db1866a9f07e5691a424 | |
| parent | 75cb5c51cdb82d971d64576cd356f708e131501f (diff) | |
| download | rust-c170bf99273ce194b7d4cf71abb946fe47d58f82.tar.gz rust-c170bf99273ce194b7d4cf71abb946fe47d58f82.zip | |
switch to the default implementation of `write_vectored`
| -rw-r--r-- | library/std/src/sys/pal/hermit/net.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/library/std/src/sys/pal/hermit/net.rs b/library/std/src/sys/pal/hermit/net.rs index 23ac71cb9f2..84ae311a741 100644 --- a/library/std/src/sys/pal/hermit/net.rs +++ b/library/std/src/sys/pal/hermit/net.rs @@ -225,17 +225,11 @@ impl Socket { } pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> { - let mut size: isize = 0; - - for i in bufs.iter() { - size += cvt(unsafe { netc::write(self.0.as_raw_fd(), i.as_ptr(), i.len()) })?; - } - - Ok(size.try_into().unwrap()) + crate::io::default_write_vectored(|b| self.write(b), bufs) } pub fn is_write_vectored(&self) -> bool { - true + false } pub fn set_timeout(&self, dur: Option<Duration>, kind: i32) -> io::Result<()> { |
