Skip to content

Commit 0403c4b

Browse files
tealsnowsqueek502
authored andcommitted
std.posix: handle INVAL in openatWasi
In accordance with #19833 (comment)
1 parent b4e7b6f commit 0403c4b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/std/posix.zig

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,10 +1676,8 @@ pub fn openatWasi(
16761676
.INTR => continue,
16771677

16781678
.FAULT => unreachable,
1679-
// FIXME: It is worth looking into returning a `error.BadPathName`
1680-
// here if wasi follows other posix behavior
1681-
// see: https://github.com/ziglang/zig/issues/15607
1682-
.INVAL => unreachable,
1679+
// Provides INVAL with a linux host on a bad path name, but NOENT on Windows
1680+
.INVAL => return error.BadPathName,
16831681
.BADF => unreachable,
16841682
.ACCES => return error.AccessDenied,
16851683
.FBIG => return error.FileTooBig,

0 commit comments

Comments
 (0)