From febc1d4cf7e7d663185103e5e888b1cdbe51a549 Mon Sep 17 00:00:00 2001 From: hemisputnik Date: Sat, 3 Oct 2026 23:46:30 +0300 Subject: [PATCH 1/2] Io.Threaded: fix wasi branch of netReadPosix post control data changes --- lib/std/Io/Threaded.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/Io/Threaded.zig b/lib/std/Io/Threaded.zig index 2c7cdbc8e99e37081200900866b94edf7672e272..77506faae7e9f30f792cd840c8ac6ba347c89b4d 100644 --- a/lib/std/Io/Threaded.zig +++ b/lib/std/Io/Threaded.zig @@ -12910,7 +12910,7 @@ fn netReadPosix(fd: net.Socket.Handle, data: [][]u8, control: []u8) net.Stream.R switch (std.os.wasi.fd_read(fd, dest.ptr, dest.len, &n)) { .SUCCESS => { syscall.finish(); - return n; + return .{ .data_len = n }; }, .INTR => { try syscall.checkCancel(); -- 2.54.0 From 78093ce4c8a0a9d9dbf2679335e02636748c39c9 Mon Sep 17 00:00:00 2001 From: hemisputnik Date: Sat, 3 Oct 2026 23:46:30 +0300 Subject: [PATCH 2/2] Io.net.Stream: fix read post control data changes --- lib/std/Io/net.zig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/std/Io/net.zig b/lib/std/Io/net.zig index 7c5ddbde5e9a711f39d250587c1a4fa95922fd3e..4b80d35a016e94a5580d3eae95106ee62e03a396 100644 --- a/lib/std/Io/net.zig +++ b/lib/std/Io/net.zig @@ -1283,11 +1283,10 @@ pub const Stream = struct { /// This is a low-level API that calls the `Io` interface function directly. /// For a higher level API, see `reader`. pub fn read(s: *const Stream, io: Io, data: [][]u8) Reader.Error!usize { - const rc, _ = try (try io.operate(.{ .net_read = .{ + return (try (try io.operate(.{ .net_read = .{ .socket_handle = s.socket.handle, .data = data, - } })).net_read; - return rc; + } })).net_read).data_len; } /// Read with control data. -- 2.54.0