authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-07-28 22:29:31-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-07-28 22:29:31-07:00
log390c7d84b24355ba3346ec1214a0a8de8a7c5df3
tree84ebe56cbb0d51b52297a880e25699c6584e4bad
parented7f11ffa75877896a2723505589499866864e50
parent0403c4b05c811576ee205438e3782986d64f8056
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #19833 from tealsnow/posix-INVAL

std.posix: handle INVAL in openZ, openatZ and openatWasi

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

lib/std/posix.zig+4-3
......@@ -1598,7 +1598,7 @@ pub fn openZ(file_path: [*:0]const u8, flags: O, perm: mode_t) OpenError!fd_t {
15981598 .INTR => continue,
15991599
16001600 .FAULT => unreachable,
1601 .INVAL => unreachable,
1601 .INVAL => return error.BadPathName,
16021602 .ACCES => return error.AccessDenied,
16031603 .FBIG => return error.FileTooBig,
16041604 .OVERFLOW => return error.FileTooBig,
......@@ -1676,7 +1676,8 @@ pub fn openatWasi(
16761676 .INTR => continue,
16771677
16781678 .FAULT => unreachable,
1679 .INVAL => unreachable,
1679 // Provides INVAL with a linux host on a bad path name, but NOENT on Windows
1680 .INVAL => return error.BadPathName,
16801681 .BADF => unreachable,
16811682 .ACCES => return error.AccessDenied,
16821683 .FBIG => return error.FileTooBig,
......@@ -1767,7 +1768,7 @@ pub fn openatZ(dir_fd: fd_t, file_path: [*:0]const u8, flags: O, mode: mode_t) O
17671768 .INTR => continue,
17681769
17691770 .FAULT => unreachable,
1770 .INVAL => unreachable,
1771 .INVAL => return error.BadPathName,
17711772 .BADF => unreachable,
17721773 .ACCES => return error.AccessDenied,
17731774 .FBIG => return error.FileTooBig,