Description
At a quick glance, the following functions are not yet provided by nix
, but would be useful to have in nix
for use by wasi-common: mkdirat
, unlinkat
, renameat
, linkat
, clock_getres
, clock_gettime
, posix_fallocate
, posix_fadvise
.
Currently code in wasi-common and lucet-wasi is calling libc interfaces for these functions directly, which requires unsafe code. Having nix
provide these will mean the unsafe code is shifted to nix
instead. This may not seem like a win on a theoretical level, but the more we can push unsafe
code into dedicated utilities that do simple unsafe things with safe, testable, interfaces, the easier it is to audit everything.
I've marked this as "help wanted" -- this is not an urgent project, but it is a nicely scoped, straightforward, and subdividable project, and it's a good chance to see some of the low-level parts of the software stack that wasi-common is built on. And mentoring is available :-).
Additional resources:
- Documentation for these functions in POSIX can be found here: http://pubs.opengroup.org/onlinepubs/9699919799/
- Here's an example of implementing a very simple function in
nix
, though the functions above are more complex and will need testcases :-).