wasi-c2: implement a synchronous poll_oneoff in terms of yanix

doesnt work on unix yet! also breaks all the rules about using the
cap-std family instead of rawfds! but this is cool and im happy with it
This commit is contained in:
Pat Hickey
2021-01-14 17:43:53 -08:00
parent b84c4d7488
commit 7f7a0be938
8 changed files with 172 additions and 60 deletions

View File

@@ -891,6 +891,10 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for WasiCtx {
events: &GuestPtr<types::Event>,
nsubscriptions: types::Size,
) -> Result<types::Size, Error> {
if nsubscriptions == 0 {
return Err(Error::Inval);
}
use cap_std::time::{Duration, SystemClock};
let table = self.table();
let mut poll = Poll::new();