From: Mark Harris Date: Thu, 29 Jan 2026 16:52:24 +0000 (-0800) Subject: man/man3/timespec_get.3: Add ISO C23 time bases X-Git-Tag: man-pages-6.17~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2eb783456af6d5b07add73f1a4794c7b195fce42;p=thirdparty%2Fman-pages.git man/man3/timespec_get.3: Add ISO C23 time bases Document new time bases TIME_MONOTONIC, TIME_ACTIVE, and TIME_THREAD_ACTIVE, introduced in ISO C23 and supported by glibc 2.43.[1] [1] Signed-off-by: Mark Harris Message-ID: <1955d9507d6ab4e482f92a4d7717872c98f39f8a.1769705123.git.mark.hsj@gmail.com> [alx: de-duplicate glibc versions] Signed-off-by: Alejandro Colomar --- diff --git a/man/man3/timespec_get.3 b/man/man3/timespec_get.3 index 0d6df4620..2af2ee942 100644 --- a/man/man3/timespec_get.3 +++ b/man/man3/timespec_get.3 @@ -29,7 +29,10 @@ Feature Test Macro Requirements for glibc (see _ISOC11_SOURCE .fi .P -.BR timespec_getres (): +.BR timespec_getres (), +.BR TIME_MONOTONIC , +.BR TIME_ACTIVE , +.BR TIME_THREAD_ACTIVE : .nf _ISOC23_SOURCE .fi @@ -68,6 +71,40 @@ are the same as those retrieved by and .IR clock_getres(CLOCK_REALTIME,\~tp) , respectively. +.TP +.B TIME_MONOTONIC +A time base that measures +time since an unspecified point in the past, +where the time within a process will not decrease +even if the system's real time clock is set or adjusted. +The time and resolution in this time base +are the same as those retrieved by +.I clock_gettime(CLOCK_MONOTONIC,\~res) +and +.IR clock_getres(CLOCK_MONOTONIC,\~tp) , +respectively. +.TP +.B TIME_ACTIVE +A process-specific time base that measures +CPU time consumed by +the calling process. +The time and resolution in this time base +are the same as those retrieved by +.I clock_gettime(CLOCK_PROCESS_CPUTIME_ID,\~res) +and +.IR clock_getres(CLOCK_PROCESS_CPUTIME_ID,\~tp) , +respectively. +.TP +.B TIME_THREAD_ACTIVE +A thread-specific time base that measures +CPU time consumed by +the calling thread. +The time and resolution in this time base +are the same as those retrieved by +.I clock_gettime(CLOCK_THREAD_CPUTIME_ID,\~res) +and +.IR clock_getres(CLOCK_THREAD_CPUTIME_ID,\~tp) , +respectively. .SH RETURN VALUE .BR timespec_get () returns the nonzero @@ -104,6 +141,12 @@ C23 (though ISO C doesn't specify the time epoch), POSIX.1-2024. .TP .BR timespec_getres () +.TQ +.B TIME_MONOTONIC +.TQ +.B TIME_ACTIVE +.TQ +.B TIME_THREAD_ACTIVE C23. .SH HISTORY .TP @@ -114,6 +157,13 @@ C11, POSIX.1-2024, glibc 2.16, musl 1.1.10. .TP .BR timespec_getres () C23, glibc 2.34. +.TP +.B TIME_MONOTONIC +.TQ +.B TIME_ACTIVE +.TQ +.B TIME_THREAD_ACTIVE +C23, glibc 2.43. .SH SEE ALSO .BR clock_gettime (2), .BR clock_getres (2)