-
Notifications
You must be signed in to change notification settings - Fork 666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use libc in poll.rs #399
Use libc in poll.rs #399
Conversation
} | ||
|
||
pub type nfds_t = c_uint; | ||
pub fn revents(&self) -> Option<EventFlags> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll also need at least read/write access to events
and possibly write access to revents
. This looks a little less ergonomic than direct access to the fields we have right now :( Maybe we can keep the struct definition as is? Are there any reasons to switch other than libc having a better test suite to verify the structure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering about that, but I could only come up with read access to revents
as necessary after creation. So, thank you for the feedback.
You text sounds like you have used poll somewhere. Can you point me code that uses it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added these bindings to nix in #228 as I planned to use it in a project but I never got around to it since then. A quick code search on Github shows atleast 2 people are using it: https://github.com/tailhook/stator and https://github.com/hjr3/carp-rs; they might have some useful feedback :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both example only need read access to revents
after creation.
I would also like to merge this soon, if noone has any further comments. I'll be happy to add read/write accessors to |
Hi @fiveop, changes look good to me. Based on my own usage of poll in the past, it would be very useful to be able to modify poll interests. For instance, with non-blocking sockets, it is useful to register for I think we can add that later without issues, so @homu r+ |
📌 Commit f4a52b3 has been approved by |
Use libc in poll.rs I'll add a change log commit, once this is reviewed.
☀️ Test successful - status |
I'll add a change log commit, once this is reviewed.