Commit Graph

219 Commits

Author SHA1 Message Date
John Nunley 45ebe3b904
v3.1.0
Signed-off-by: John Nunley <dev@notgull.net>
2023-09-25 09:42:41 -07:00
David Hotham 254577da8d
feat: introduce Event::new()
This makes it easier to construct Events.
2023-09-12 06:02:02 -07:00
Taiki Endo 8c99506375 Update actions/checkout action to v4 2023-09-10 18:28:12 +09:00
John Nunley 256542375c
v3.0.0
Signed-off-by: John Nunley <dev@notgull.net>
2023-09-04 18:41:32 -07:00
John Nunley 90c661f5e1 Remove the std default feature
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>
2023-09-04 22:15:28 +02:00
John Nunley 7718565d11
Remove libc from dev deps (#146)
Signed-off-by: John Nunley <dev@notgull.net>
Signed-off-by: Alain Zscheile <fogti+devel@ytrizja.de>
2023-09-04 22:12:42 +02:00
Alex Touchet 792618094c
docs: Fix CI badge and update links
Closes #142
2023-09-04 08:33:22 -07:00
Taiki Endo 9a3fe18981 Use std::os::raw::c_int and remove our own type alias 2023-08-30 02:19:17 +09:00
tison d8595b56a5
feat: Make the constructors for Event const
This allows the Event struct to be used in constants.

Signed-off-by: tison <wander4096@gmail.com>
2023-08-21 18:32:21 -07:00
John Nunley c7cc91a1f1
docs: Specify behavior when registered in multiple pollers
This adds documentation to add() describing what happens when a source
is registered in multiple pollers. A test is also added to ensure this
behavior.

Signed-off-by: John Nunley <dev@notgull.net>
2023-08-16 09:48:14 -07:00
John Nunley 2c279b871c
feat: Add a pipe-based notifier to epoll
In some containers, eventfd is not available as it cannot be implemented
securely in some hosts. This commit adds a fallback notifier that uses
a pipe instead of eventfd.

Closes #122

Signed-off-by: John Nunley <dev@notgull.net>
2023-08-16 08:33:58 -07:00
John Nunley a521cd2c29
breaking: Extract the Events struct and make the Event struct opaque
* Add better documentation for the IOCP module

* Extract Events from Poller

This prevents the need to have an intermediate buffer to read events
from, reducing the need for an allocation and a copy. This is a breaking
change.

* Add event extra information

Foundation for more details later on.

* Add PRI and HUP events
* Fix various failing tests

- Make sure that waitable handles interact properly with the new
  infrastructure
- Fix failing doctests

* Review comments

- Make set_* take a boolean for the value of the flag
- Make Events !Sync
- Fix visibility modifiers
- Inline more methods
- Use a better strategy for testing

* Move completion packets into the Events buffer

This removes one of the mutexes that we have to lock.

* Review comments

Signed-off-by: John Nunley <dev@notgull.net>
2023-08-14 10:03:20 -07:00
John Nunley e42664d57e
m: Remove libc from our dependencies
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>
2023-08-13 18:49:43 -07:00
John Nunley c6a0890627
feat: Add support for waiting on waitable handles
* 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>
2023-08-08 20:40:21 -07:00
ivmarkov 6d13def8ab
Allow pinning Rust nightly to concrete version (#132) 2023-08-07 02:24:30 +09:00
ivmarkov 26afefbbbc
Remove patch.crates-io now that rustix 0.38.7 is out (#131) 2023-08-06 14:58:11 +09:00
John Nunley 49152081d0
Fix failing CI (#130)
- Disable async-io tests for wine
- Fix errant cast in Android

Signed-off-by: John Nunley <dev@notgull.net>
2023-08-05 08:17:53 -07:00
ivmarkov 53793382a7
feat: Support for the ESP-IDF framework
* Support for the ESP-IDF framework

* Restore the spans to work with the raw notify fd

* On Linux eventfd needs PollFlags::IN

* Add cargo check for ESP IDF to the CI

---------

Co-authored-by: imarkov <imarkov@vmware.com>
2023-08-05 07:28:59 -07:00
John Nunley 6eb7679aa3
breaking: Rework the API for I/O safety
* Rework the API for I/O safety

* Bump to rustix v0.38
2023-08-03 20:15:59 -07:00
John Nunley c86c3894c1
Add smol-rs logo (#127) 2023-07-17 14:30:22 +09:00
dependabot[bot] ea5946c453 Update fastrand requirement from 1.9.0 to 2.0.0
Updates the requirements on [fastrand](https://github.com/smol-rs/fastrand) to permit the latest version.
- [Release notes](https://github.com/smol-rs/fastrand/releases)
- [Changelog](https://github.com/smol-rs/fastrand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/fastrand/compare/v1.9.0...v2.0.0)

---
updated-dependencies:
- dependency-name: fastrand
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-16 19:16:56 +09:00
Taiki Endo d41c05447a
Revert "Temporarily disable the wine test (#118)" (#126)
This reverts commit e2129ea879.

The upstream bug has been fixed.
2023-07-12 00:03:08 +09:00
John Nunley a8eb2dfc48
m: Remove the bitflags dependency 2023-06-28 20:19:12 -07:00
John Nunley 7a1fd31944
Replace log with tracing (#119) 2023-06-20 20:28:18 -07:00
John Nunley e2129ea879
Temporarily disable the wine test (#118) 2023-06-11 10:40:08 -07:00
John Nunley 5df378f811
Bump MSRV to 1.63 (#117)
Removes the build script and bumps bitflags to v2
2023-06-11 10:37:25 -07:00
Ivan Zvonimir Horvat e161698e6c
114: Examples; add nc message in 2 listeners (#115) 2023-05-31 08:50:27 -07:00
Taiki Endo 5e4410c937
Use Cirrus CI for NetBSD/OpenBSD (#110) 2023-04-29 06:05:19 +09:00
John Nunley 8d8d2efcc2
Replace libc with rustix in some backends (#108) 2023-04-23 07:26:29 -07:00
John Nunley d3a171b88b
v2.8.0 (#107) 2023-04-20 14:50:12 -07:00
John Nunley 75cff30584
feat: Add functionality for posting events to the IOCP (#101) 2023-04-16 07:37:48 -07:00
Taiki Endo 1e966a0848
Test patched async-io on more platforms (#79) 2023-04-10 15:34:34 +09:00
John Nunley 6857a165aa
Use the try-iter method from concurrent-queue (#105) 2023-04-08 22:05:37 -07:00
John Nunley 8f6d039b26
v2.7.0 (#104)
- Add edge/oneshot combination mode. (#96)
- Update windows-sys requirement from 0.45 to 0.48. (#103)
2023-04-07 11:20:57 -07:00
Taiki Endo 1e101c500f Update windows-sys to 0.48 2023-04-04 04:25:36 +09:00
John Nunley 0f38ed35ea
Add edge/oneshot combination mode (#96) 2023-03-25 15:22:45 +01:00
John Nunley e340458d3a
ci: Fix Android breakage (#99) 2023-03-22 11:21:31 -07:00
John Nunley e10c7e8da1
Version 2.6.0 (#92) 2023-03-08 10:42:18 -08:00
John Nunley f48f2c1a5a
test: Add test for more than 32 connections (#93)
Making sure that this works on Windows after #88
2023-03-08 10:40:23 -08:00
John Nunley 24900fb662
m(windows): Reimplement Wepoll in Rust (#88)
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.
2023-03-05 16:25:25 -08:00
Taiki Endo e85331c437 Fix Dragonfly BSD CI
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)
```
2023-03-04 15:35:17 +09:00
Taiki Endo 1e4467b1be Test more Windows targets on CI
- Test x86_64 gnu, i686 msvc, i686 gnu on Windows host
- Test patched async-io with Wine
2023-03-04 15:35:17 +09:00
Taiki Endo d443196f64 Use image_family for FreeBSD image in Cirrus CI 2023-02-06 22:02:43 +09:00
John Nunley a5aae98805
feat: Expose other kqueue filters (#83)
* feat: Expose other kqueue filters

* Fix netbsd/openbsd compilation

* Build MSRV for FreeBsd/OpenBsd in CI

* Only run MSRV BSD builds on Linux

* Change API a little + fix netbsd timer

* Add inlines + move PollerSealed

* rustfmt

* Make filter fields public

* Fix examples
2023-02-03 11:14:33 -08:00
dependabot[bot] 914aa48d67 Update windows-sys requirement from 0.42 to 0.45
Updates the requirements on [windows-sys](https://github.com/microsoft/windows-rs) to permit the latest version.
- [Release notes](https://github.com/microsoft/windows-rs/releases)
- [Commits](https://github.com/microsoft/windows-rs/compare/0.42.0...0.45.0)

---
updated-dependencies:
- dependency-name: windows-sys
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-23 23:41:01 +09:00
Taiki Endo 900b00c061 Test NetBSD/OpenBSD/Dragonfly BSD with vmactions 2023-01-23 00:15:00 +09:00
Taiki Endo ff86c54dfd Minimize GITHUB_TOKEN permissions
Refs: https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token
2023-01-21 20:38:57 +09:00
Taiki Endo 9b67232ea4 Test FreeBSD with Cirrus CI 2023-01-21 20:38:57 +09:00
Taiki Endo 3bc6310121 Set CARGO_NET_GIT_FETCH_WITH_CLI=true in CI 2023-01-21 20:38:57 +09:00
John Nunley 27f23a9384
m: Use EVFILT_USER instead of a self-pipe on kqueue where supported (#73)
* Use EVFILT_USER instead of a self-pipe

* Fix kqueue flags
2023-01-12 21:35:49 -08:00