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 40ae1df 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:
args_getargs_sizes_getclock_res_getclock_time_getenviron_getenviron_sizes_getfd_closefd_datasyncfd_preadfd_pwritefd_readfd_renumberfd_seekfd_tellfd_fdstat_getfd_fdstat_set_flagsfd_fdstat_set_rightsfd_syncfd_writefd_advisefd_allocatepath_create_directorypath_linkpath_openfd_readdirpath_readlinkpath_renamefd_filestat_getfd_filestat_set_timesfd_filestat_set_sizepath_filestat_getpath_filestat_set_timespath_symlinkpath_unlink_filepath_remove_directorypoll_oneofffd_prestat_getfd_prestat_dir_nameproc_exitrandom_getsched_yield
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.