Bug 199049 - man 7 time refers to gettimeofday that is declared as obsolete by posix
Summary: man 7 time refers to gettimeofday that is declared as obsolete by posix
Status: RESOLVED CODE_FIX
Alias: None
Product: Documentation
Classification: Unclassified
Component: man-pages (show other bugs)
Hardware: All Linux
: P1 low
Assignee: documentation_man-pages@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-07 16:42 UTC by Enrique Garcia
Modified: 2018-03-09 08:00 UTC (History)
1 user (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Enrique Garcia 2018-03-07 16:42:35 UTC
Under "The Epoch" there is a paragraph which refers to the system call gettimeofday(2). Since this has been marked as obsolete as of POSIX.1-2008 it would be better to refer to clock_gettime(2) instead.
Comment 1 Michael Kerrisk 2018-03-09 08:00:00 UTC
Agreed. I applied the patch below. Closing this now. Please reopen if you think something still needs fixing.


diff --git a/man7/time.7 b/man7/time.7
index a9282c45b..7b84c2d44 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

Note You need to log in before you can comment on or make changes to this bug.