Merge pull request #22536 from BryceVandegrift/access-er13

std.posix: Fix errno 13 when writing to file
This commit is contained in:
Andrew Kelley 2025-01-21 00:10:05 -05:00 committed by GitHub
commit 744771d330
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,
@ -1269,6 +1268,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,