commit 344f4d9bc586507c00324cd3844b9b9f778a3c65 (tree)
parent 986aa42d3e68df5caf2421238c3f68b870baced1
Author: Christian Wesselhoeft <hi@xtian.us>
Date: Sat, 18 Apr 2020 05:49:38 -0600
std.os.readv: Add missing iov_count declaration
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/std/os.zig b/lib/std/os.zig
@@ -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);