authorgravatar for hi@xtian.usChristian Wesselhoeft <hi@xtian.us> 2020-04-18 05:49:38-06:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-04-18 14:32:52-04:00
log344f4d9bc586507c00324cd3844b9b9f778a3c65
treecc4c525cf27f1ba9c91f8af4a2ace6d6684dc90e
parent986aa42d3e68df5caf2421238c3f68b870baced1

std.os.readv: Add missing iov_count declaration


1 files changed, 2 insertions(+), 1 deletions(-)

lib/std/os.zig+2-1
...@@ -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 }
373373
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 @intCast376 // 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);