Import all changes from lucet-wasi

This commit is contained in:
Jakub Konka
2019-05-17 22:41:40 +02:00
committed by Dan Gohman
parent bbdaf7b686
commit b9871648b2
4 changed files with 1238 additions and 517 deletions

View File

@@ -8,7 +8,7 @@
[Wasmtime]: https://github.com/CraneStation/wasmtime
[Lucet]: https://github.com/fastly/lucet
[lucet-wasi]: https://github.com/fastly/lucet/tree/master/lucet-wasi
[lucet-wasi-tracker]: https://github.com/fastly/lucet/commit/5d3efb6005391a7c71d585732a5507b00db6bb1e
[lucet-wasi-tracker]: https://github.com/fastly/lucet/commit/40ae1df64536250a2b6ab67e7f167d22f4aa7f94
[WASI API]: https://github.com/CraneStation/wasmtime/blob/master/docs/WASI-api.md
This repo will ultimately serve as a library providing a common implementation of
@@ -16,7 +16,7 @@ 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][lucet-wasi-tracker] git revision.
currently based on [40ae1df][lucet-wasi-tracker] git revision.
Please note that the library requires Rust compiler version at least 1.34.0.
@@ -25,28 +25,47 @@ Please note that the library requires Rust compiler version at least 1.34.0.
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`
- `args_get`
- `args_sizes_get`
- `clock_res_get`
- `clock_time_get`
- `environ_get`
- `environ_sizes_get`
- `fd_close`
- `fd_datasync`
- `fd_pread`
- `fd_pwrite`
- `fd_read`
- `fd_renumber`
- `fd_seek`
- `fd_tell`
- `fd_fdstat_get`
- `fd_fdstat_set_flags`
- `fd_fdstat_set_rights`
- `fd_sync`
- `fd_write`
- `fd_advise`
- `fd_allocate`
- `path_create_directory`
- `path_link`
- `path_open`
- `fd_readdir`
- `path_readlink`
- `path_rename`
- `fd_filestat_get`
- `fd_filestat_set_times`
- `fd_filestat_set_size`
- `path_filestat_get`
- `path_filestat_set_times`
- `path_symlink`
- `path_unlink_file`
- `path_remove_directory`
- `poll_oneoff`
- `fd_prestat_get`
- `fd_prestat_dir_name`
- `proc_exit`
- `random_get`
- `sched_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.