Commit 07c1be80c2

Tadeo Kondrak <me@tadeo.ca>
2020-04-29 12:33:05
Fix std.event.Loop.readv
1 parent 5929e5c
Changed files (1)
lib
std
event
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,