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

Please support CLOCK_BOOTTIME in clock_gettime on Linux #905

Closed
joshtriplett opened this issue Oct 28, 2023 · 3 comments · Fixed by #927
Closed

Please support CLOCK_BOOTTIME in clock_gettime on Linux #905

joshtriplett opened this issue Oct 28, 2023 · 3 comments · Fixed by #927
Labels
enhancement New feature or request

Comments

@joshtriplett
Copy link
Member

rustix::time::ClockId contains the clock IDs that always work, so that clock_gettime can't return an error. This enum already varies by platform, with some values only available on cfg(linux_kernel), and some values only available on not(cfg(apple)) for instance.

CLOCK_BOOTTIME is available on a variety of platforms, including Linux 2.6.39 and newer. Even Debian oldoldstable has a 4.19 kernel. RHEL 7 is ten years old and uses a 3.10 kernel.

If those aren't sufficient, then could you please:

  • Add support under the linux_4_11 feature flag, and
  • Document the minimum supported kernel version for rustix?

Thank you!

@sunfishcode
Copy link
Member

Thanks for the report! Rustix's current (and currently undocumented) policy has been to support Linux 2.6.32, but it does seem to make sense to change that, and document it. I filed #907 to propose this and collect feedback.

In the meantime, adding Boottime to ClockId under linux_4_11 also sounds reasonable to me. I'll submit a PR when I get around to it, or I'd accept a PR if anyone wants to submit one sooner 😄.

@sunfishcode sunfishcode added the enhancement New feature or request label Oct 28, 2023
@sunfishcode
Copy link
Member

#911 will add Boottime to ClockkId under linux_4_11.

sunfishcode added a commit that referenced this issue Nov 10, 2023
Add a Minimum Linux Version policy, which is currently Linux 3.2, and
enable `ClockId::Boottime` and other values without extra feature gates.

Fixes #905.
Fixes #907.
sunfishcode added a commit that referenced this issue Nov 10, 2023
Add a Minimum Linux Version policy, which is currently Linux 3.2, and
enable `ClockId::Boottime` and other values without extra feature gates.

Fixes #905.
Fixes #907.
sunfishcode added a commit that referenced this issue Nov 10, 2023
Add a Minimum Linux Version policy, which is currently Linux 3.2, and
enable `ClockId::Boottime` and other values without extra feature gates.

Fixes #905.
Fixes #907.
@sunfishcode
Copy link
Member

#911, adding Boottime to ClockId under linux_4_11 is now released in 0.38.22.

I've also opened #927 to update the minimum supported Linux version to 3.2 and make Boottime available unconditionally.

sunfishcode added a commit that referenced this issue Nov 17, 2023
Add a Minimum Linux Version policy, which is currently Linux 3.2, and
enable `ClockId::Boottime` and other values without extra feature gates.

Fixes #905.
Fixes #907.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants