add the concept of cwd to standard library file system abstraction for WASI #10749
Labels
contributor friendly
This issue is limited in scope and/or knowledge of Zig internals.
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
os-wasi
standard library
This issue involves writing Zig code for the standard library.
Milestone
Here's how they do it in WASI libc:
In the Zig standard library, what we currently do for WASI is this:
zig/lib/std/fs.zig
Lines 2242 to 2245 in abbcf40
Notice that for WASI libc however they have an "emulated FD_ATCWD". It looks like it just treats
/
as the cwd.Instead of erroring out, let's follow this convention by returning fd =
std.os.wasi.AT.FDCWD
which matches the WASI libc convention of-2
.Then we have to check for FD_ATCWD at every std.os function (see similar code in the WASI libc PR linked above). For example:
This is a prerequisite for #10716.
The text was updated successfully, but these errors were encountered: