authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-01-21 00:10:05-05:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2025-01-21 00:10:05-05:00
log744771d3303e122474a72c8a94b14fe1e9fb480c
treeb5b558f621516c470ea14d78d24114ca365bd298
parent160445ef316f76dfddfa17b11c4919a3e14f486d
parent1110950528ac0bfe19d92a69d37b502a7465f4a6
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #22536 from BryceVandegrift/access-er13

std.posix: Fix errno 13 when writing to file

1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/posix.zig+2-2
...@@ -1169,8 +1169,7 @@ pub const WriteError = error{...@@ -1169,8 +1169,7 @@ pub const WriteError = error{
1169 DeviceBusy,1169 DeviceBusy,
1170 InvalidArgument,1170 InvalidArgument,
11711171
1172 /// In WASI, this error may occur when the file descriptor does1172 /// File descriptor does not hold the required rights to write to it.
1173 /// not hold the required rights to write to it.
1174 AccessDenied,1173 AccessDenied,
1175 BrokenPipe,1174 BrokenPipe,
1176 SystemResources,1175 SystemResources,
...@@ -1269,6 +1268,7 @@ pub fn write(fd: fd_t, bytes: []const u8) WriteError!usize {...@@ -1269,6 +1268,7 @@ pub fn write(fd: fd_t, bytes: []const u8) WriteError!usize {
1269 .FBIG => return error.FileTooBig,1268 .FBIG => return error.FileTooBig,
1270 .IO => return error.InputOutput,1269 .IO => return error.InputOutput,
1271 .NOSPC => return error.NoSpaceLeft,1270 .NOSPC => return error.NoSpaceLeft,
1271 .ACCES => return error.AccessDenied,
1272 .PERM => return error.AccessDenied,1272 .PERM => return error.AccessDenied,
1273 .PIPE => return error.BrokenPipe,1273 .PIPE => return error.BrokenPipe,
1274 .CONNRESET => return error.ConnectionResetByPeer,1274 .CONNRESET => return error.ConnectionResetByPeer,