PATCH: Change manpage of times(2) to recommend clock_gettime(2), not gettimeofday(2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Change manpage of times(2) to recommend clock_gettime(2), not gettimeofday(2)

>From times(2):
  "To measure changes in elapsed time, use gettimeofday(2) instead."

>From gettimeofday(2):
  "POSIX.1-2008 marks gettimeofday() as obsolete, recomending  the
  use of clock_gettime(2) instead."

Some context, showing how use of gettimeofday() causes actual bugs
(also read comments):
http://blog.habets.pp.se/2010/09/gettimeofday-should-never-be-used-to-measure-time


diff --git a/man2/times.2 b/man2/times.2
index a37874e..020103a 100644
--- a/man2/times.2
+++ b/man2/times.2
@@ -174,7 +174,7 @@ combined with the fact that the returned value may overflow
 .IR clock_t ,
 means that a portable application would be wise to avoid using this value.
 To measure changes in elapsed time, use
-.BR gettimeofday (2)
+.BR clock_gettime (2)
 instead.
 .\" .PP
 .\" On older systems the number of clock ticks per second is given
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux