HermitOS is a microkernel target aiming to provide a simple OS for
virtualized applications. It recently added support for the poll() and
eventfd() system calls, which means we can target it with our poll()
based backend.
Hermit does not have a traditional libc; instead it uses hermit-abi.
However rustix does not support using hermit-abi as its underlying
layer yet. So we have to build a shim layer until it does.
Closes#177
cc bytecodealliance/rustix#1012
Signed-off-by: John Nunley <dev@notgull.net>
Technically RedoxOS supports the poll syscall, so we already support
RedoxOS. However, this is very slow. This commit ports this code to
epoll, which should be more efficient.
Closes#176
Previous, `Poller::wait` would bubble signal interruption error to the user.
However, this may be unexpected for simple use cases. Thus, this commit makes
it so, if `ErrorKind::Interrupted` is received by the underlying `wait()` call,
it clears the events and tries to wait again.
This also adds a test for this interruption written by @psychon.
Co-Authored-By: Uli Schlachter <psychon@users.noreply.github.com>
Signed-off-by: John Nunley <dev@notgull.net>
Added in 272bb11eaf for reasons that are
unclear to me. It serves no purpose aside from disabling the API of the
entire crate, so it's best to remove it.
Signed-off-by: John Nunley <dev@notgull.net>
This means that we only depend on rustix, so all of the system calls
are direct. This should make mustang integration trivial.
Signed-off-by: John Nunley <dev@notgull.net>
* Add support for polling waitable handles
* Add a smoke test
* Fix failing tests
* Rebase on latest master
Signed-off-by: John Nunley <dev@notgull.net>
* Update semantics for new system
Signed-off-by: John Nunley <dev@notgull.net>
* Forgot about doctests
Signed-off-by: John Nunley <dev@notgull.net>
---------
Signed-off-by: John Nunley <dev@notgull.net>
Reimplements the C-based wepoll backend in Rust, using some handwritten code. This PR also implements bindings to the I/O Completion Ports and \Device\Afd APIs. For more information on the latter, see my blog post on the subject: https://notgull.github.io/device-afd/
Note that the IOCP API is wrapped using a `Pin`-oriented "CompletionHandle" system that is relatively brittle. This should be replaced with a better model when one becomes available.