authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2020-04-30 11:00:27+03:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2020-04-30 11:00:27+03:00
log611bd8e9f49bd3532a23c49f6b675da03403b635
tree356a0606825d02520c14c9a99d80c2cea3e7112a
parent611a1436f022e777caf4eea8d1e6c81edc22a43f
parent07c1be80c2e656520d431287ff4af78823e19233
signature Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #5213 from tadeokondrak/evented-readv-fix

Fix std.event.Loop.readv

1 files changed, 12 insertions(+), 0 deletions(-)

lib/std/event/loop.zig+12
...@@ -1080,6 +1080,9 @@ pub const Loop = struct {...@@ -1080,6 +1080,9 @@ pub const Loop = struct {
1080 .read => |*msg| {1080 .read => |*msg| {
1081 msg.result = noasync os.read(msg.fd, msg.buf);1081 msg.result = noasync os.read(msg.fd, msg.buf);
1082 },1082 },
1083 .readv => |*msg| {
1084 msg.result = noasync os.readv(msg.fd, msg.iov);
1085 },
1083 .write => |*msg| {1086 .write => |*msg| {
1084 msg.result = noasync os.write(msg.fd, msg.bytes);1087 msg.result = noasync os.write(msg.fd, msg.bytes);
1085 },1088 },
...@@ -1174,6 +1177,7 @@ pub const Loop = struct {...@@ -1174,6 +1177,7 @@ pub const Loop = struct {
11741177
1175 pub const Msg = union(enum) {1178 pub const Msg = union(enum) {
1176 read: Read,1179 read: Read,
1180 readv: ReadV,
1177 write: Write,1181 write: Write,
1178 writev: WriteV,1182 writev: WriteV,
1179 pwritev: PWriteV,1183 pwritev: PWriteV,
...@@ -1195,6 +1199,14 @@ pub const Loop = struct {...@@ -1195,6 +1199,14 @@ pub const Loop = struct {
1195 pub const Error = os.ReadError;1199 pub const Error = os.ReadError;
1196 };1200 };
11971201
1202 pub const ReadV = struct {
1203 fd: os.fd_t,
1204 iov: []const os.iovec,
1205 result: Error!usize,
1206
1207 pub const Error = os.ReadError;
1208 };
1209
1198 pub const Write = struct {1210 pub const Write = struct {
1199 fd: os.fd_t,1211 fd: os.fd_t,
1200 bytes: []const u8,1212 bytes: []const u8,