Re: 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]

 



Hello Thomas,

On Sun, Oct 7, 2012 at 11:37 PM, Thomas Habets <thomas@xxxxxxxxx> wrote:
> 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

Thanks! Applied.

Cheers,

Michael


> 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



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/
--
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