commit 611bd8e9f49bd3532a23c49f6b675da03403b635 (tree)
parent 611a1436f022e777caf4eea8d1e6c81edc22a43f
Author: Vexu <git@vexu.eu>
Date: Thu, 30 Apr 2020 11:00:27 +0300
Merge pull request #5213 from tadeokondrak/evented-readv-fix
Fix std.event.Loop.readv
Diffstat:
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/lib/std/event/loop.zig b/lib/std/event/loop.zig
@@ -1080,6 +1080,9 @@ pub const Loop = struct {
.read => |*msg| {
msg.result = noasync os.read(msg.fd, msg.buf);
},
+ .readv => |*msg| {
+ msg.result = noasync os.readv(msg.fd, msg.iov);
+ },
.write => |*msg| {
msg.result = noasync os.write(msg.fd, msg.bytes);
},
@@ -1174,6 +1177,7 @@ pub const Loop = struct {
pub const Msg = union(enum) {
read: Read,
+ readv: ReadV,
write: Write,
writev: WriteV,
pwritev: PWriteV,
@@ -1195,6 +1199,14 @@ pub const Loop = struct {
pub const Error = os.ReadError;
};
+ pub const ReadV = struct {
+ fd: os.fd_t,
+ iov: []const os.iovec,
+ result: Error!usize,
+
+ pub const Error = os.ReadError;
+ };
+
pub const Write = struct {
fd: os.fd_t,
bytes: []const u8,