[PATCH] time: Use CLOCK_REALTIME for time (BZ #30200)

Florian Weimer fweimer@redhat.com
Wed Mar 8 08:59:47 GMT 2023


* Paul Eggert:

> On 2023-03-07 04:07, Florian Weimer via Libc-alpha wrote:
>> Probably RESOLVED/MOVED because we get whatever time the kernel
>> provides.  It seems a deliberate kernel decision to me.
>
> For my own information, is 'time' the only standard function that uses
> a clock other than CLOCK_REALTIME and so can be out-of-sync with
> timespec_get? What about gettimeofday, futimens with UTIME_NOW, or
> timestamps set by modifying files?

Even if the same underlying clock is used, rounding may cause interface
which use different precision for the fractional seconds part to report
different integral seconds.  The standard does not require rounding
towards minus infinity.

Thanks,
Florian



More information about the Libc-alpha mailing list