mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:24:33 +01:00
std.Io.Threaded: ntReadFileResult handles EOF + bytes available
This commit is contained in:
parent
4dd7fe90a2
commit
8f8aa8346a
1 changed files with 4 additions and 2 deletions
|
|
@ -8709,8 +8709,10 @@ fn ntReadFileResult(io_status_block: *const windows.IO_STATUS_BLOCK) !usize {
|
|||
.PENDING => unreachable,
|
||||
.CANCELLED => unreachable,
|
||||
.SUCCESS => return io_status_block.Information,
|
||||
.END_OF_FILE => return error.EndOfStream,
|
||||
.PIPE_BROKEN => return error.EndOfStream,
|
||||
.END_OF_FILE, .PIPE_BROKEN => {
|
||||
if (io_status_block.Information == 0) return error.EndOfStream;
|
||||
return io_status_block.Information;
|
||||
},
|
||||
.INVALID_DEVICE_REQUEST => return error.IsDir,
|
||||
.LOCK_NOT_GRANTED => return error.LockViolation,
|
||||
.ACCESS_DENIED => return error.AccessDenied,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue