zig/lib/std/c
Cody Tapscott 58f961f4cb 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.
2022-03-03 14:31:49 -07:00
..
darwin debug: implement segfault handler for macOS aarch64 2022-02-07 16:34:05 -05:00
darwin.zig time: introduce Instant (#10972) 2022-02-24 18:51:44 -05:00
dragonfly.zig Adds Linux support for POSIX file locking with fcntl 2022-02-15 13:22:50 +02:00
emscripten.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
freebsd.zig Adds Linux support for POSIX file locking with fcntl 2022-02-15 13:22:50 +02:00
fuchsia.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
haiku.zig add constant for haiku 2022-02-26 10:53:13 +02:00
hermit.zig std: reorganization that allows new usingnamespace semantics 2021-09-01 17:54:06 -07:00
linux.zig std: validate frame-pointer address in stack walking 2022-02-11 15:28:36 +01:00
minix.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
netbsd.zig Adds Linux support for POSIX file locking with fcntl 2022-02-15 13:22:50 +02:00
openbsd.zig fix formatting in openbsd.zig 2022-02-20 11:58:42 +02:00
solaris.zig Adds Linux support for POSIX file locking with fcntl 2022-02-15 13:22:50 +02:00
tokenizer.zig std lib API deprecations for the upcoming 0.9.0 release 2021-11-30 00:13:07 -07:00
wasi.zig stdlib: Add emulated CWD to std.os for WASI targets 2022-03-03 14:31:49 -07:00
windows.zig stage1, stage2: rename c_void to anyopaque (#10316) 2021-12-19 00:24:45 -05:00