Skip to content

Commit b1a1896

Browse files
remove dead offset code from impl_nio_read_iovec (readv returns on first data)
Agent-Logs-Url: https://github.com/acl-dev/open-coroutine/sessions/3ee10e36-26e4-49a6-88c3-bc465b166e2f Co-authored-by: loongs-zhang <38336731+loongs-zhang@users.noreply.github.com>
1 parent 555e595 commit b1a1896

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

core/src/syscall/unix/mod.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,6 @@ macro_rules! impl_nio_read_iovec {
567567
let mut r = -1;
568568
let mut index = 0;
569569
'outer: for iovec in &vec {
570-
let offset = received.saturating_sub(length);
571570
length += iovec.iov_len;
572571
if received > length {
573572
index += 1;
@@ -578,12 +577,6 @@ macro_rules! impl_nio_read_iovec {
578577
arg.push(*i);
579578
}
580579
while received < length && left_time > 0 {
581-
if 0 != offset {
582-
arg[0] = libc::iovec {
583-
iov_base: (arg[0].iov_base as usize + offset) as *mut std::ffi::c_void,
584-
iov_len: arg[0].iov_len - offset,
585-
};
586-
}
587580
r = self.inner.$syscall(
588581
fn_ptr,
589582
$fd,

0 commit comments

Comments
 (0)