aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorCody Tapscott <topolarity@tapscott.me>2022-03-03 12:25:21 -0700
committerJakub Konka <kubkon@jakubkonka.com>2022-04-16 18:08:05 +0200
commit7b090df6689909ba82ff46be4d21733f84f32c33 (patch)
tree105f0782e6ec8cd105402c689db814f8720c5858 /src/codegen
parent8f75823728d247bc11d916b7257d7eebc7be06de (diff)
downloadzig-7b090df6689909ba82ff46be4d21733f84f32c33.tar.gz
zig-7b090df6689909ba82ff46be4d21733f84f32c33.zip
stdlib std.os: Improve wasi-libc parity for WASI CWD emulation
Two major changes here: 1. We store the CWD as a simple `[]const u8` and lookup Preopens for every absolute or CWD-referenced file operation, based on the Preopen with the longest match (i.e. most specific path) 2. Preorders are normalized to POSIX absolute paths at init time. Behavior depends on the "cwd_root" parameter of `initPreopensWasi`: `cwd_root` is used for any Preopens that start with "." For example: "./foo/bar" - inits to -> "{cwd_root}/foo/bar" "foo/bar" - inits to -> "/foo/bar" "/foo/bar" - inits to -> "/foo/bar" `cwd_root` must be an absolute path. Using "/" as `cwd_root` gives behavior similar to wasi-libc.
Diffstat (limited to 'src/codegen')
0 files changed, 0 insertions, 0 deletions