| ... | @@ -370,7 +370,8 @@ pub fn readv(fd: fd_t, iov: []const iovec) ReadError!usize { | ... | @@ -370,7 +370,8 @@ pub fn readv(fd: fd_t, iov: []const iovec) ReadError!usize { |
| 370 | const first = iov[0]; | 370 | const first = iov[0]; |
| 371 | return read(fd, first.iov_base[0..first.iov_len]); | 371 | return read(fd, first.iov_base[0..first.iov_len]); |
| 372 | } | 372 | } |
| 373 | | 373 | |
| | 374 | const iov_count = math.cast(u31, iov.len) catch math.maxInt(u31); |
| 374 | while (true) { | 375 | while (true) { |
| 375 | // TODO handle the case when iov_len is too large and get rid of this @intCast | 376 | // TODO handle the case when iov_len is too large and get rid of this @intCast |
| 376 | const rc = system.readv(fd, iov.ptr, iov_count); | 377 | const rc = system.readv(fd, iov.ptr, iov_count); |