aboutsummaryrefslogtreecommitdiffstats
path: root/man7/time.7
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2018-03-09 08:57:45 +0100
committerMichael Kerrisk <mtk.manpages@gmail.com>2018-03-16 08:50:36 +0100
commit39ad46695fb18b00d6164849cc6327e945fc6a93 (patch)
treea2a7b8d5542f100c36c8885dcd646f9c8e19a4f8 /man7/time.7
parent8f8b643d85b9fbb7b483b83419a0d087739ab4da (diff)
downloadman-pages-39ad46695fb18b00d6164849cc6327e945fc6a93.tar.gz
time.7: Mention clock_gettime()/clock_settime() rather than [gs]ettimeofday()
gettimeofday() is declared obsolete by POSIX. Mention instead the modern APIs for working with the realtime clock. See https://bugzilla.kernel.org/show_bug.cgi?id=199049 Reported-by: Enrique Garcia <cquike@arcor.de> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man7/time.7')
-rw-r--r--man7/time.711
1 files changed, 7 insertions, 4 deletions
diff --git a/man7/time.7 b/man7/time.7
index a9282c45b9..7b84c2d44f 100644
--- a/man7/time.7
+++ b/man7/time.7
@@ -130,15 +130,18 @@ UNIX systems represent time in seconds since the
.PP
A program can determine the
.I "calendar time"
-using
-.BR gettimeofday (2),
-which returns time (in seconds and microseconds) that have
+via the
+.BR clock_gettime (2)
+.BR CLOCK_REALTIME
+clock,
+which returns time (in seconds and nanoseconds) that have
elapsed since the Epoch;
.BR time (2)
provides similar information, but only with accuracy to the
nearest second.
The system time can be changed using
-.BR settimeofday (2).
+.BR clock_settime (2).
+.\"
.SS Broken-down time
Certain library functions use a structure of
type