]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
man/man3/timespec_get.3: Add ISO C23 time bases
authorMark Harris <mark.hsj@gmail.com>
Thu, 29 Jan 2026 16:52:24 +0000 (08:52 -0800)
committerAlejandro Colomar <alx@kernel.org>
Tue, 10 Feb 2026 23:00:40 +0000 (00:00 +0100)
Document new time bases TIME_MONOTONIC, TIME_ACTIVE, and
TIME_THREAD_ACTIVE, introduced in ISO C23 and supported by
glibc 2.43.[1]

[1] <https://sourceware.org/git/?p=glibc.git;a=commit;h=f28a11e43f40>

Signed-off-by: Mark Harris <mark.hsj@gmail.com>
Message-ID: <1955d9507d6ab4e482f92a4d7717872c98f39f8a.1769705123.git.mark.hsj@gmail.com>
[alx: de-duplicate glibc versions]
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man/man3/timespec_get.3

index 0d6df4620dab5ab9426a1c553d8b92026495b5f0..2af2ee94232835dabdfb3afbe0350036c444a26c 100644 (file)
@@ -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)