aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorCody Tapscott <topolarity@tapscott.me>2022-03-01 10:17:05 -0700
committerCody Tapscott <topolarity@tapscott.me>2022-03-03 14:31:49 -0700
commit58f961f4cb9875bbce3070969438ecf08f392c9f (patch)
tree0e4c4f98c023a9d3dd093dc63e519e26d9154930 /src/codegen
parent3605dd307ffff74726cc0ce5099599f1a6f9ddb2 (diff)
downloadzig-58f961f4cb9875bbce3070969438ecf08f392c9f.tar.gz
zig-58f961f4cb9875bbce3070969438ecf08f392c9f.zip
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the current working directory. The `*at(...)` functions look for this and resolve relative paths against the stored CWD. Absolute paths are dynamically matched against the stored Preopens. "os.initPreopensWasi()" must be called before std.os functions will resolve relative or absolute paths correctly. This is asserted at runtime. Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`, `fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`, and `faccessat`. This also includes limited support for `getcwd()` and `realpath()`. These return an error if the CWD does not correspond to a Preopen with an absolute path. They also do not currently expand symlinks.
Diffstat (limited to 'src/codegen')
0 files changed, 0 insertions, 0 deletions