Skip to content

Conversation

@notgull
Copy link
Member

@notgull notgull commented Mar 2, 2023

Rustix 0.37's alpha just released, with implementations of epoll, kqueue and event ports. This PR configures polling such that it uses rustix instead of libc.

WIP, so far only the Epoll backend is done

See also: bytecodealliance/rustix#496, smol-rs/async-io#76

notgull and others added 5 commits March 2, 2023 15:38
- Test x86_64 gnu, i686 msvc, i686 gnu on Windows host
- Test patched async-io with Wine
Dragonfly BSD 6.4.0 VM doesn't seem to have git.

```
  error: failed to get `cfg-if` as a dependency of package `polling v2.5.2 (/Users/runner/work/polling/polling)`

  Caused by:
    failed to load source for dependency `cfg-if`

  Caused by:
    Unable to update registry `crates-io`

  Caused by:
    failed to fetch `https://github.com/rust-lang/crates.io-index`

  Caused by:
    could not execute process `git fetch --force --update-head-ok 'https://github.com/rust-lang/crates.io-index' '+HEAD:refs/remotes/origin/HEAD'` (never executed)

  Caused by:
    No such file or directory (os error 2)
```
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.
@notgull notgull closed this Apr 18, 2023
@notgull notgull deleted the notgull/rustix branch April 18, 2023 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants