Closed deepj closed 2 years ago
I'm curious, which library uses this constant?
No one in my case, I just saw this in Ruby 2.4 NEWS. So I just was curious to try it 😇
For Linux we need to implement
CLOCK_REALTIME_COARSE
CLOCK_REALTIME_ALARM
CLOCK_MONOTONIC_COARSE
CLOCK_BOOTTIME
CLOCK_BOOTTIME_ALARM
Fix on the way.
Sorry this was fixed ages ago, forgot to close it.
This doesn't seem fixed or fixed still? On latest truffleruby:
Process::CLOCK_BOOTTIME
(irb):4:in `const_missing': uninitialized constant Process::CLOCK_BOOTTIME (NameError)
Did you mean? Process::CLOCK_REALTIME
It was fixed but regressed, unfortunately the test guard was written incorrectly and so missed the regression (I'll fix that). The regression is 37b70d4120f732598708e01195f644c833e2baba. So the fundamental issue is our CI platform (Oracle Linux 7) doesn't have these clocks, and so we can't reliably expose the clock value since the clock might or not exist depending on the Linux version.
@nickh-stripe Do you need CLOCK_BOOTTIME
for something specific? Isn't CLOCK_MONOTONIC
enough?
I've got a fix. The trade-off is it will also define these clocks as Process constants on older Linux, and using them with clock_gettime
raises EINVAL
.
Thanks, just some existing code was using it, I don't know enough about why to say whether it could be substituted, just thought reporting it for a easy fix might be beneficial to all 👍 thanks for the quick turnaround.
This is specific for macOS and it was introduced in Ruby 2.4. See https://github.com/ruby/ruby/blob/v2_4_0/NEWS
To reproduce (only on macOS, I guess):
Error: