Skip to content
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

Change poll's timeout from c_int to Option<&Timespec>. #1285

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sunfishcode
Copy link
Member

This harmonizes the timeout with the rest of rustix, which uses Timespec for all time values. And, it eliminates the awkwardness of using -1 as a sentinel value.

On platforms with ppoll, the Timespec can be passed straight to the OS. On platforms without ppoll, we have to do a fallible conversion into c_int.

This harmonizes the timeout with the rest of rustix, which uses
`Timespec` for all time values. And, it eliminates the awkwardness
of using `-1` as a sentinel value.

On platforms with `ppoll`, the `Timespec` can be passed straight
to the OS. On platforms without `ppoll`, we have to do a fallible
conversion into `c_int`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant