Use wiggle "trappable error" to implement wasi-common (#5279)

* convert wasi-common from defining its own error to using wiggle trappable error

* wasi-common impl crates: switch error strategy

* wasmtime-wasi: error is trappable, and no longer requires UserErrorConversion

* docs

* typo

* readdir: windows fixes

* fix windows scheduler errors

fun fact! the Send and Recv errors here that just had a `.context` on
them were previously not being captured in the downcasting either. They
need to be traps, and would have ended up that way by ommission, but
you'd never actually know that by reading the code!
This commit is contained in:
Pat Hickey
2022-11-16 16:57:22 -08:00
committed by GitHub
parent de6e4a4e20
commit 56daa8a199
12 changed files with 461 additions and 467 deletions

View File

@@ -47,7 +47,7 @@ pub async fn poll_oneoff<'a>(poll: &mut Poll<'a>) -> Result<(), Error> {
match rustix::io::poll(&mut pollfds, poll_timeout) {
Ok(ready) => break ready,
Err(rustix::io::Errno::INTR) => continue,
Err(err) => return Err(err.into()),
Err(err) => return Err(std::io::Error::from(err).into()),
}
};
if ready > 0 {