std.os.readv: Add missing iov_count declaration

This commit is contained in:
Christian Wesselhoeft 2020-04-18 05:49:38 -06:00 committed by Andrew Kelley
parent 986aa42d3e
commit 344f4d9bc5

View File

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