[PATCH v2] time: Add TIME_MONOTONIC, TIME_ACTIVE, and TIME_THREAD_ACTIVE

Florian Weimer fweimer@redhat.com
Tue Nov 25 08:35:33 GMT 2025


* Adhemerval Zanella:

> The TIME_MONOTONIC maps to POSIX's CLOCK_MONOTONIC, TIME_ACTIVE to
> CLOCK_PROCESS_CPUTIME_ID, and TIME_THREAD_ACTIVE to
> CLOCK_THREAD_CPUTIME_ID.
>
> No Linux specific timer are added as extension.

I think we should come up with some general transformation of the clock
ID values.  It would help us if WG14 lifted the requirement that clock
IDs must be positive integers.  The interfaces they defined merely
require that valid clock IDs are not zeros.  Once negative values are
permitted, we only have to special-case the zero value.  New clocks then
are just a matter of kernel support and defining the appropriate
constants in a header file.

Would someone in the ISO system please submit a DR?  I think for us,
permitting negative values would work, as would making the clock base
type unsigned.

Thanks,
Florian



More information about the Libc-alpha mailing list