dec_slice_of safe.
Make `dec_slice_of` return a slice rather than a pointer-length pair, freeing its users from having to call the unsafe `slice::from_raw_parts`. This requires splitting `dec_slice_of` and `dec_ptr` into mut and non-mut versions, and reorganizing poll_oneoff a little to avoid borrow-checker errors -- decoded slices do alias the main memory, so make sure functions only need one or the other.
wasi-common
This repo will ultimately serve as a library providing a common implementation of WASI hostcalls for re-use in any WASI (and potentially non-WASI) runtimes such as Wasmtime and Lucet.
The library is an adaption of lucet-wasi crate from the Lucet project, and it is currently based on 5d3efb6005 git revision.
Please note that the library requires Rust compiler version at least 1.34.0.
Supported syscalls
We support a subset of the WASI API, though we are working on new hostcalls on a regular basis. We currently implement:
__wasi_args_get__wasi_args_sizes_get__wasi_clock_res_get__wasi_clock_time_get__wasi_environ_get__wasi_environ_sizes_get__wasi_fd_close__wasi_fd_fdstat_get__wasi_fd_fdstat_set_flags__wasi_fd_filestat_get__wasi_fd_prestat_dir_name__wasi_fd_prestat_get__wasi_fd_read__wasi_fd_seek__wasi_fd_write__wasi_path_open__wasi_path_filestat_get__wasi_path_create_directory__wasi_path_unlink_file__wasi_poll_oneoff__wasi_proc_exit__wasi_random_get
This is enough to run basic C and Rust programs, including those that use command-line arguments, environment variables, stdio, and basic file operations.
Third-Party Code
Significant parts of our hostcall implementations are derived from the C implementations in
cloudabi-utils. See LICENSE.cloudabi-utils for license information.