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

timerfd: Add TFD_TIMER_CANCEL_ON_SET flag #2040

Merged
merged 1 commit into from
May 21, 2023

Conversation

apohrebniak
Copy link
Contributor

Hi.
This PR adds an TFD_TIMER_CANCEL_ON_SET flag to use with timerfd on Linux and Android

@apohrebniak apohrebniak force-pushed the timerfd-TFD_TIMER_CANCEL_ON_SET branch from 011717e to 18ea6ae Compare May 18, 2023 11:34
Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but how about a test?

@apohrebniak apohrebniak force-pushed the timerfd-TFD_TIMER_CANCEL_ON_SET branch from 18ea6ae to a4dd9cd Compare May 20, 2023 22:24
@apohrebniak
Copy link
Contributor Author

apohrebniak commented May 20, 2023

Changed the documentation a bit.

Looks good, but how about a test?

The only way I can think of is to actually tweak a CLOCK_REALTIME, which would interfere with other processes while running tests either locally or in CI(except the ones running on a dedicated VM?). Unfortunately, it's not possible to hide it under time_namespaces:

       Note that time namespaces do not virtualize the CLOCK_REALTIME
       clock.  Virtualization of this clock was avoided for reasons of
       complexity and overhead within the kernel.

Am I missing something? Will happily add a test if so.

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that makes sense. We certainly don't want to adjust the system clock during these tests.

bors r+

@bors bors bot merged commit dfc689a into nix-rust:master May 21, 2023
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.

2 participants