When linking libc, we follow their convention and use -2 for current working directory. However, without libc, Zig does a different convention: it assumes the current working directory is the first preopen. This behavior can be overridden with a public function called wasi_cwd
in the root source file.