Commit Graph

24 Commits

Author SHA1 Message Date
Nikolay Arhipov 9e46c8455c
feat: ported to Vita target
Fixes #160
2024-04-20 11:22:46 -07:00
irvingouj @ Devolutions e25b3b4e4c
feat: Replace is_connect_failed with is_err
In linux, epoll, EPOLLHUP may happen even if no connection call is made. It
would confuse callers for what is actually happening.

Replaced is_connect_failed, and we detect if connection failed by using the
combination of is_err and is_interrupt, please see the example, tcp_client
2024-03-20 22:04:46 -07:00
John Nunley 50454d1cea
feat: Add support for HermitOS
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>
2024-03-12 21:33:06 -07:00
John Nunley 62430fd56e Annotate ESP-IDF EPERM error with eventfd info
If eventfd isn't initialized, `Polling::new` will fail with an EPERM
error. You need to call the "esp_vfs_eventfd_register" function to
initialize the eventfd subsystem in ESP-IDF. This commit indicates to
the user that this needs to happen.

Signed-off-by: John Nunley <dev@notgull.net>
2024-01-27 21:17:58 -08:00
irvingouj @ Devolutions cf25dd85f8
feat: Add the ability to identify if the connection has failed 2024-01-26 12:58:39 -08:00
Taiki Endo 37a1d4ecd2
Remove needless imports (#159) 2023-10-08 17:23:34 +09:00
Al Hoang 99a32b7607
feat: Add support for Haiku OS
Haiku does not support pipe_with at all, so just fall back to pipe().
2023-10-01 20:57:41 -07: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 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
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 7a1fd31944
Replace log with tracing (#119) 2023-06-20 20:28:18 -07:00
John Nunley 8d8d2efcc2
Replace libc with rustix in some backends (#108) 2023-04-23 07:26:29 -07:00
John Nunley 0f38ed35ea
Add edge/oneshot combination mode (#96) 2023-03-25 15:22:45 +01:00
John Nunley dc4c5b4ec0
bugfix: Prevent large timeouts from causing panics (#71) 2023-01-07 19:35:46 -08:00
John Nunley 181acc67d0
Add level and edge triggered modes to the poller (#59)
* Add level and edge triggered modes to the poller

* Refractor error handling

* Add tests for new modes
2022-12-30 14:43:47 -08:00
Kestrer ee13911717 Remove `extra_traits` libc feature 2021-09-04 17:58:56 +01:00
Kestrer 9c257ccef6 Cast to `nfds_t` instead of `u64` in `poll` 2021-09-04 17:47:54 +01:00
Kestrer c174c9b7bb Prevent timeout overflow for poll and wepoll 2021-05-26 10:33:24 +01:00
Kestrer e0c0032cc0 swap_remove deleted file descriptors in poll backend 2021-05-26 10:25:24 +01:00
Koxiaet 20c1e19c46 Have notifications break poll's operation loop 2020-12-18 15:03:59 +00:00
Koxiaet dd15b4cd8a Add logging to poll backend 2020-12-18 14:33:05 +00:00
Koxiaet e0789a8ee0 Make poll's poller modifications interrupt `wait` 2020-12-18 14:18:03 +00:00
Koxiaet 2fc0831d40 Use poll on VxWorks, Fuchsia and other Unix systems 2020-12-17 18:56:48 +00:00