wasi-libc
wasi-libc copied to clipboard
chdir("..") from "/bin" changes the current directory to "/bin/.." instead of "/"
I've mapped a single directory (which contains a "bin" subdirectory) as "/" like that:
wasmtime run --mapdir /::testdir prog.wasm
On program start, getcwd() returns "/", which is expected. Calling chdir("bin") causes getcwd() to return "/bin", which is also expected. Then, calling chdir(".") causes getcwd() to still return "/bin", which is also expected and great. However, calling chdir("..") causes getcwd() to return "/bin/..". I think in this case, it should return "/".
Forgot to say that I'm using wasi-sdk 12.0
the issue still open on wasi-sdk-21