]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
man/man3/timespec_get.3: Refactor to prepare for new time bases
authorMark Harris <mark.hsj@gmail.com>
Thu, 29 Jan 2026 16:52:23 +0000 (08:52 -0800)
committerAlejandro Colomar <alx@kernel.org>
Tue, 10 Feb 2026 23:00:38 +0000 (00:00 +0100)
Add Feature Test Macro Requirements to document functions and macros
that require ISO C11 or C23, and arrange supported time bases as a list.

Signed-off-by: Mark Harris <mark.hsj@gmail.com>
Message-ID: <ec8dfdc495cb8d58e945b370658c6945cb424327.1769705123.git.mark.hsj@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man/man3/timespec_get.3

index 79bb82226b5ec2a10afc5f1ef3f6c5764ccddb7b..0d6df4620dab5ab9426a1c553d8b92026495b5f0 100644 (file)
@@ -17,6 +17,22 @@ Standard C library
 .BI "int timespec_get(struct timespec *" res ", int " base );
 .BI "int timespec_getres(struct timespec *" tp ", int " base );
 .fi
+.P
+.RS -4
+Feature Test Macro Requirements for glibc (see
+.BR feature_test_macros (7)):
+.RE
+.P
+.BR timespec_get (),
+.BR TIME_UTC :
+.nf
+    _ISOC11_SOURCE
+.fi
+.P
+.BR timespec_getres ():
+.nf
+    _ISOC23_SOURCE
+.fi
 .SH DESCRIPTION
 The
 .BR timespec_get ()
@@ -39,16 +55,19 @@ is non-NULL.
 For a particular time base,
 the resolution is constant for the lifetime of the calling process.
 .P
+The time base
+.I base
+is one of the following:
+.TP
 .B TIME_UTC
-is always a supported time base,
-and is the only time base supported on Linux.
+A system-wide time base that measures
+real (i.e., wall-clock) time.
 The time and resolution in this time base
 are the same as those retrieved by
 .I clock_gettime(CLOCK_REALTIME,\~res)
 and
 .IR clock_getres(CLOCK_REALTIME,\~tp) ,
 respectively.
-Other systems may support additional time bases.
 .SH RETURN VALUE
 .BR timespec_get ()
 returns the nonzero
@@ -78,6 +97,7 @@ T}    Thread safety   MT-Safe
 .SH STANDARDS
 .TP
 .BR timespec_get ()
+C23, POSIX.1-2024.
 .TQ
 .B TIME_UTC
 C23 (though ISO C doesn't specify the time epoch),