This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: BZ #2636: Fix times return value, CLK_TCK descripts
- From: Andreas Jaeger <aj at suse dot com>
- To: libc-alpha at sourceware dot org
- Date: Tue, 10 Apr 2012 09:22:23 +0200
- Subject: Re: BZ #2636: Fix times return value, CLK_TCK descripts
- References: <4F818786.5090708@suse.com>
On Sunday, April 08, 2012 14:41:42 Andreas Jaeger wrote:
> The description of CLK_TCK, _SC_CLK_TCK and the return value of times
> are wrong. Here's a patch to fix this.
>
> Ok to install?
>
> Andreas
>
> 2012-04-08 Andreas Jaeger <aj@suse.de>
>
> [BZ #2636]
> * manual/time.texi (Processor Time): Return type of times () is
> elapsed real time since an arbitrary point in the past.
> (CPU Time): Move CLK_TCK from here...
> (Processor Time): ...to here. Correct description.
> * manual/conf.texi (Constants for Sysconf): Correct description of
> _SC_CLK_TCK.
>
>
> diff --git a/manual/conf.texi b/manual/conf.texi
> index 2cd41f6..99a3fd8 100644
> --- a/manual/conf.texi
> +++ b/manual/conf.texi
> @@ -360,7 +360,8 @@ Inquire about the parameter corresponding to
> @code{_POSIX_VERSION}. @comment unistd.h
> @comment POSIX.1
> @item _SC_CLK_TCK
> -Inquire about the parameter corresponding to @code{CLOCKS_PER_SEC};
> +The number of clock tickets per second, the corresponding parameter is
> +obsolete, it was called @code{CLK_TCK};
> @pxref{CPU Time}.
>
> @comment unistd.h
> diff --git a/manual/time.texi b/manual/time.texi
> index a410def..dcfcf5a 100644
> --- a/manual/time.texi
> +++ b/manual/time.texi
> @@ -237,12 +237,6 @@ million independent of the actual resolution.
> @end deftypevr
>
> @comment time.h
> -@comment POSIX.1
> -@deftypevr Macro int CLK_TCK
> -This is an obsolete name for @code{CLOCKS_PER_SEC}.
> -@end deftypevr
> -
> -@comment time.h
> @comment ISO
> @deftp {Data Type} clock_t
> This is the type of the value returned by the @code{clock} function.
> @@ -303,6 +297,15 @@ of the calling process.
>
> All of the times are given in numbers of clock ticks. Unlike CPU time,
> these are the actual amounts of time; not relative to any event.
> +
> +@comment time.h
> +@comment POSIX.1
> +@deftypevr Macro int CLK_TCK
> +This is an obsolete name for the number of clock ticks per second, use
> +@code{sysconf (_SC_CLK_TCK)} instead.
> +@end deftypevr
> +
> +
> @xref{Creating a Process}.
> @end deftp
>
> @@ -312,9 +315,9 @@ these are the actual amounts of time; not relative
> to any event. The @code{times} function stores the processor time
> information for the calling process in @var{buffer}.
>
> -The return value is the calling process' CPU time (the same value you
> -get from @code{clock()}. @code{times} returns @code{(clock_t)(-1)} to
> -indicate failure.
> +The return value is the number of clock ticks since an arbitrary point
> +in the past, e.g. since system start up. @code{times} returns
This one misses two spaces after the sentence.
Ok to commit with the above change?
Andreas
> +@code{(clock_t)(-1)} to indicate failure.
> @end deftypefun
>
> @strong{Portability Note:} The @code{clock} function described in
--
Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126