mirror of https://github.com/mkerrisk/man-pages
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>
This commit is contained in:
parent
8f8b643d85
commit
39ad46695f
11
man7/time.7
11
man7/time.7
|
@ -130,15 +130,18 @@ UNIX systems represent time in seconds since the
|
||||||
.PP
|
.PP
|
||||||
A program can determine the
|
A program can determine the
|
||||||
.I "calendar time"
|
.I "calendar time"
|
||||||
using
|
via the
|
||||||
.BR gettimeofday (2),
|
.BR clock_gettime (2)
|
||||||
which returns time (in seconds and microseconds) that have
|
.BR CLOCK_REALTIME
|
||||||
|
clock,
|
||||||
|
which returns time (in seconds and nanoseconds) that have
|
||||||
elapsed since the Epoch;
|
elapsed since the Epoch;
|
||||||
.BR time (2)
|
.BR time (2)
|
||||||
provides similar information, but only with accuracy to the
|
provides similar information, but only with accuracy to the
|
||||||
nearest second.
|
nearest second.
|
||||||
The system time can be changed using
|
The system time can be changed using
|
||||||
.BR settimeofday (2).
|
.BR clock_settime (2).
|
||||||
|
.\"
|
||||||
.SS Broken-down time
|
.SS Broken-down time
|
||||||
Certain library functions use a structure of
|
Certain library functions use a structure of
|
||||||
type
|
type
|
||||||
|
|
Loading…
Reference in New Issue