-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
timeval: use CLOCK_MONOTONIC_RAW if available #11291
Conversation
Reported-by: Harry Sintonen Ref: #11288
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.
Theoretically, CLOCK_MONOTONIC_RAW could exist and be found by autoconf but the system call could fail, while CLOCK_MONOTONIC would succeed. On Linux, this would happen if run on really old kernels (like 2.6.27) so it's probably not worth worrying about there, but what other systems support CLOCK_MONOTONIC_RAW? If there are others, or there could be others in the future, it might be worth calling both, with CLOCK_MONOTONIC only if CLOCK_MONOTONIC_RAW fails.
macOS supports CLOCK_MONOTONIC_RAW. I don't know since which version... |
What weirdness would cause that to happen? |
Building on a recent kernel but running on an old one.
|
@dfandrich what do you think of this approach? |
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.
Looks good to me. This should work fine now even on old (possibly ancient?) systems.
Reported-by: Harry Sintonen Ref: curl#11288 Closes curl#11291
Reported-by: Harry Sintonen Ref: curl#11288 Closes curl#11291
Reported-by: Harry Sintonen
Ref: #11288