authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-01-30 12:27:27-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-01-30 16:58:26-08:00
logdd463caa15f2474880085ddff073d619d02a5610
tree60393e7e2c82d95d2180395a4b6f6751adf44390
parent3d3f22a14d7639f1a7c607da98926da6e60c3b01

std.Io.Threaded: stop checking bytes read with END_OF_FILE


1 files changed, 3 insertions(+), 5 deletions(-)

lib/std/Io/Threaded.zig+3-5
......@@ -8816,9 +8816,10 @@ fn fileReadStreamingPosix(file: File, data: []const []u8) File.ReadStreamingErro
88168816fn fileReadStreamingWindows(file: File, data: []const []u8) File.ReadStreamingError!usize {
88178817 var io_status_block: windows.IO_STATUS_BLOCK = .{
88188818 .u = .{ .Status = .PENDING },
8819 .Information = 0,
8819 .Information = undefined,
88208820 };
88218821 try ntReadFile(file.handle, data, &noopApc, null, &io_status_block);
8822
88228823 while (@atomicLoad(windows.NTSTATUS, &io_status_block.u.Status, .acquire) == .PENDING) {
88238824 // Once we get here we must not return from the function until the
88248825 // operation completes, thereby releasing reference to io_status_block.
......@@ -8842,10 +8843,7 @@ fn ntReadFileResult(io_status_block: *const windows.IO_STATUS_BLOCK) !usize {
88428843 .PENDING => unreachable,
88438844 .CANCELLED => unreachable,
88448845 .SUCCESS => return io_status_block.Information,
8845 .END_OF_FILE, .PIPE_BROKEN => {
8846 if (io_status_block.Information == 0) return error.EndOfStream;
8847 return io_status_block.Information;
8848 },
8846 .END_OF_FILE, .PIPE_BROKEN => return error.EndOfStream,
88498847 .INVALID_DEVICE_REQUEST => return error.IsDir,
88508848 .LOCK_NOT_GRANTED => return error.LockViolation,
88518849 .ACCESS_DENIED => return error.AccessDenied,