From e4d570695777af643e375343a904a024250de98d Mon Sep 17 00:00:00 2001 From: Bryce Vandegrift Date: Sat, 18 Jan 2025 14:21:12 -0500 Subject: [PATCH 1/2] std.posix: Fix errno 13 when writing to file --- lib/std/posix.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/std/posix.zig b/lib/std/posix.zig index f99875437d81..d176eecaa58c 100644 --- a/lib/std/posix.zig +++ b/lib/std/posix.zig @@ -1269,6 +1269,7 @@ pub fn write(fd: fd_t, bytes: []const u8) WriteError!usize { .FBIG => return error.FileTooBig, .IO => return error.InputOutput, .NOSPC => return error.NoSpaceLeft, + .ACCES => return error.AccessDenied, .PERM => return error.AccessDenied, .PIPE => return error.BrokenPipe, .CONNRESET => return error.ConnectionResetByPeer, From 1110950528ac0bfe19d92a69d37b502a7465f4a6 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 20 Jan 2025 21:08:44 -0800 Subject: [PATCH 2/2] std.posix.WriteError: update AccessDenied docs It can happen on POSIX too. --- lib/std/posix.zig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/std/posix.zig b/lib/std/posix.zig index d176eecaa58c..71d7baa99948 100644 --- a/lib/std/posix.zig +++ b/lib/std/posix.zig @@ -1169,8 +1169,7 @@ pub const WriteError = error{ DeviceBusy, InvalidArgument, - /// In WASI, this error may occur when the file descriptor does - /// not hold the required rights to write to it. + /// File descriptor does not hold the required rights to write to it. AccessDenied, BrokenPipe, SystemResources,