Use rsix to make system calls in Wasmtime. (#3355)
* Use rsix to make system calls in Wasmtime. `rsix` is a system call wrapper crate that we use in `wasi-common`, which can provide the following advantages in the rest of Wasmtime: - It eliminates some `unsafe` blocks in Wasmtime's code. There's still an `unsafe` block in the library, but this way, the `unsafe` is factored out and clearly scoped. - And, it makes error handling more consistent, factoring out code for checking return values and `io::Error::last_os_error()`, and code that does `errno::set_errno(0)`. This doesn't cover *all* system calls; `rsix` doesn't implement signal-handling APIs, and this doesn't cover calls made through `std` or crates like `userfaultfd`, `rand`, and `region`.
This commit is contained in:
@@ -15,18 +15,18 @@ wasi-common = { path = "../", version = "0.30.0" }
|
||||
wasi-cap-std-sync = { path = "../cap-std-sync", version = "0.30.0" }
|
||||
wiggle = { path = "../../wiggle", version = "0.30.0" }
|
||||
tokio = { version = "1.8.0", features = [ "rt", "fs", "time", "io-util", "net", "io-std", "rt-multi-thread"] }
|
||||
cap-std = "0.19.0"
|
||||
cap-fs-ext = "0.19.0"
|
||||
cap-time-ext = "0.19.0"
|
||||
fs-set-times = "0.11.0"
|
||||
system-interface = { version = "0.14.0", features = ["cap_std_impls"] }
|
||||
cap-std = "0.19.1"
|
||||
cap-fs-ext = "0.19.1"
|
||||
cap-time-ext = "0.19.1"
|
||||
fs-set-times = "0.12.0"
|
||||
system-interface = { version = "0.15.0", features = ["cap_std_impls"] }
|
||||
tracing = "0.1.19"
|
||||
bitflags = "1.2"
|
||||
anyhow = "1"
|
||||
io-lifetimes = { version = "0.3.0", default-features = false }
|
||||
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
rsix = "0.22.4"
|
||||
rsix = "0.23.0"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
winapi = "0.3"
|
||||
@@ -36,4 +36,4 @@ lazy_static = "1.4"
|
||||
tempfile = "3.1.0"
|
||||
tokio = { version = "1.8.0", features = [ "macros" ] }
|
||||
anyhow = "1"
|
||||
cap-tempfile = "0.19.0"
|
||||
cap-tempfile = "0.19.1"
|
||||
|
||||
Reference in New Issue
Block a user