Commit Graph

251 Commits

Author SHA1 Message Date
Koxiaet e0789a8ee0 Make poll's poller modifications interrupt `wait` 2020-12-18 14:18:03 +00:00
Koxiaet 0f2f6ed15a Don't set CURRENT_WEEK in CI 2020-12-17 19:08:08 +00:00
Koxiaet 2fc0831d40 Use poll on VxWorks, Fuchsia and other Unix systems 2020-12-17 18:56:48 +00:00
Stjepan Glavina 4df98de5ae
. 2020-11-30 12:30:45 +01:00
Stjepan Glavina 30fcade0e4
Merge pull request #23 from papertigers/illumos-fixes
port_dissociate should be aware of ENOENT
2020-10-20 16:08:39 +02:00
Mike Zeller 6f778cddf1 port_dissociate should be aware of ENOENT 2020-10-19 22:19:12 +00:00
Stjepan Glavina 9c7e8061c5 Bump to v2.0.2 2020-10-19 00:25:40 +02:00
Stjepan Glavina 3a3020bb5c Use as_ptr and as_mut_ptr 2020-10-19 00:24:56 +02:00
Stjepan Glavina f4ee76fb32 Bump to v2.0.1 2020-10-09 14:10:22 +02:00
Stjepan Glavina 421bfc635d Reenable async-io tests 2020-10-03 17:09:03 +02:00
Stjepan Glavina 112da8b4e5 Bump to v2.0.0 2020-10-03 16:35:24 +02:00
Stjepan Glavina 7d1a4e3fe3
Merge pull request #18 from stjepang/fix-sigsegv
Try fixing sigsegv
2020-10-02 19:30:17 +02:00
Stjepan Glavina e8023dcb58 Put back winapi 2020-10-02 19:25:43 +02:00
Stjepan Glavina 5bd5cd226c Update wepoll-sys to 3.0.0 2020-10-02 19:19:18 +02:00
Stjepan Glavina 0bc0553217 Switch to published wepoll-sys 2020-10-02 18:34:49 +02:00
Stjepan Glavina b562ab84ea Use notified flag to make timeouts correct 2020-10-02 18:31:00 +02:00
Stjepan Glavina b25847f0ed Try fixing sigsegv 2020-10-02 18:24:37 +02:00
Stjepan Glavina 89ef82d11d Fix wepoll-sys version 2020-10-02 18:20:55 +02:00
Stjepan Glavina a3c748bcd0 Use more explicit type conversions 2020-10-02 18:19:15 +02:00
Stjepan Glavina 8b656241d5 Use saturating_add to prevent overflow 2020-10-02 18:17:45 +02:00
Stjepan Glavina d4667889b4 Switch to wepoll-sys 2020-10-02 17:41:55 +02:00
Stjepan Glavina 0a299cf060 Small cleanup 2020-10-02 17:34:53 +02:00
Stjepan Glavina 35add590ce
Merge pull request #17 from YorickPeterse/separate-poller-methods
Refactor Poller.add and Poller.interest
2020-10-02 16:32:20 +02:00
Yorick Peterse 29791dec13
Temporarily disable async-io tests
These will fail until a new version of polling is released and async-io
is updated.
2020-10-02 01:32:44 +02:00
Yorick Peterse ba05307af1
Separate adding and modifying of file descriptors
This replaces Poller.insert() and Poller.interest() with Poller.add()
and Poller.modify(), and renames Poller.remove() to Poller.delete().

The method Poller.add() is used for adding a new file descriptor, while
Poller.modify() is used for updating an existing one. Poller.remove() is
renamed to Poller.delete() so the naming scheme of these methods follows
that of epoll, wepoll, etc.

This new setup means that adding a new socket only requires a single
call of Poller.add(), instead of a combination of Poller.insert() and
Poller.interest(). This reduces the amount of system calls necessary,
and leads to a more pleasant API.

On systems that use kqueue or ports, the behaviour of Poller.add() and
Poller.modify() is the same. This is because on these systems adding an
already existing file descriptor will just update its configuration.
This however is an implementation detail and should not be relied upon
by users.

Migrating to this new API is pretty simple, simply replace this:

    poller.insert(&socket);
    poller.interest(&socket, event);

With this:

    poller.add(&socket, event);

And for cases where Poller.interest() was used for updating an existing
file descriptor, simply replace it will a call to Poller.modify().

See https://github.com/stjepang/polling/issues/16 and
https://github.com/stjepang/polling/pull/17 for more information.
2020-10-01 21:50:59 +02:00
Yorick Peterse 4e5c3ce836
Don't automatically make descriptors non-blocking
This adds redundant system call overhead for file descriptors which have
already been turned into non-blocking file descriptors. In addition, the
polling crate doesn't need to implement platform specific code for
enabling non-blocking mode. Instead, users of polling can do so using
(for example) standard library methods such as
TcpListener.set_nonblocking().

See https://github.com/stjepang/polling/issues/16 for more information.
2020-10-01 20:06:07 +02:00
Stjepan Glavina 5309d571b2 Bump to v1.1.0 2020-09-20 17:45:49 +02:00
Stjepan Glavina 272bb11eaf Add feature 2020-09-20 17:45:24 +02:00
Stjepan Glavina 8c7ce8fb5b Bump to v1.0.3 2020-09-16 11:46:25 +02:00
Stjepan Glavina 8a77220000
Merge pull request #15 from JayceFayne/deps
remove `libc` dependency on windows
2020-09-16 11:45:32 +02:00
Jayce Fayne 2ecb5564e8 remove `libc` dependency on windows 2020-09-16 11:23:03 +02:00
Stjepan Glavina 8e35897e53 Bump to v1.0.2 2020-09-15 20:53:33 +02:00
Stjepan Glavina c2e3322b1e
Merge pull request #10 from oblique/master
Check if `epoll_create1` is implemented by its error code
2020-09-15 20:51:19 +02:00
oblique f7f67e8745 Fix linkage error for android-16 toolchain 2020-09-15 14:01:09 +03:00
oblique 62103c1ef0 Check if `epoll_create1` is implemented by its error code
If binary is statically linked to libc then `libc::dlsym`
will always return `NULL`. This is the case when a target
with musl is used.

To fix this we check if error code of `epoll_create1` is `ENOSYS`.
2020-09-15 14:01:09 +03:00
Stjepan Glavina 4fc3040bff Pass timeout in ms to epoll_wait 2020-09-14 21:06:16 +02:00
Stjepan Glavina a954600d6a Bump MSRV to 1.40.0 2020-09-14 20:44:44 +02:00
Stjepan Glavina 46634fc32a Fix CI 2020-09-14 20:38:59 +02:00
Stjepan Glavina d8c32a0140 Test async-io 2020-09-14 20:31:23 +02:00
Stjepan Glavina 7738ca0b25 Remove doc-comment because the readme then needs the ugly #-prefixed line 2020-09-07 19:53:31 +02:00
Stjepan Glavina 1992605564 Bump to v1.0.1 2020-09-07 19:41:24 +02:00
Stjepan Glavina b05877c3ec Bump to v1.0.0 2020-09-07 16:44:39 +02:00
Stjepan Glavina 8c2f5e4169 Bump to v0.1.9 2020-09-06 11:10:54 +02:00
Stjepan Glavina 6d4724ba35 Test on Linux x32 2020-09-06 10:56:48 +02:00
Stjepan Glavina a8e3673939
Merge pull request #14 from sunfishcode/master
Fix compilation on x32
2020-09-06 10:54:10 +02:00
Dan Gohman d22ed8fd7b Fix compilation on x32
Fix compilation on x86_64-unknown-linux-gnux32, where
libc's timespec's `tv_nsec` is [defined as `i64`]. See also
[this bug] bug for further discussion.

[defined as `i64`]: https://github.com/rust-lang/libc/blob/master/src/unix/mod.rs#L61
[this bug]: https://sourceware.org/bugzilla/show_bug.cgi?id=16437
2020-09-05 22:17:26 -07:00
Stjepan Glavina f03bb7acf0 Bump to v0.1.8 2020-09-03 12:56:12 +02:00
Stjepan Glavina bc3dc1ec6e Replace log::debug with log::trace 2020-09-03 12:55:46 +02:00
Stjepan Glavina 6e4bd15786 Bump to v0.1.7 2020-09-01 07:06:52 +02:00
Stjepan Glavina 8974861fa0
Merge pull request #12 from stjepang/insert-oneshot
Specify oneshot when inserting into epoll/wepoll
2020-09-01 07:06:09 +02:00