Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/gen Note that times now uses sysconf(_SC_CLK_TCK) t...



details:   https://anonhg.NetBSD.org/src/rev/f52079f47624
branches:  trunk
changeset: 533178:f52079f47624
user:      perry <perry%NetBSD.org@localhost>
date:      Sun Jun 23 21:32:01 2002 +0000

description:
Note that times now uses sysconf(_SC_CLK_TCK) ticks, not CLK_TCK
ticks. Although the two are the same, SuS now says you use the former,
not the latter, to get the information. Also, fill in a little
information on just how awful this crusty wreck is.

diffstat:

 lib/libc/gen/times.3 |  32 +++++++++++++++++++++-----------
 1 files changed, 21 insertions(+), 11 deletions(-)

diffs (61 lines):

diff -r 894583dceb2f -r f52079f47624 lib/libc/gen/times.3
--- a/lib/libc/gen/times.3      Sun Jun 23 21:31:12 2002 +0000
+++ b/lib/libc/gen/times.3      Sun Jun 23 21:32:01 2002 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: times.3,v 1.11 2002/02/07 07:00:18 ross Exp $
+.\"    $NetBSD: times.3,v 1.12 2002/06/23 21:32:01 perry Exp $
 .\"
 .\" Copyright (c) 1990, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -55,13 +55,22 @@
 .Pp
 The
 .Fn times
-function returns the value of time in
-.Dv CLK_TCK Ns 's
-of a second since
-0 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Universal
-Time (UTC).
+function returns the value of time in clock ticks since 0 hours, 0
+minutes, 0 seconds, January 1, 1970, Coordinated Universal Time (UTC).
 .Pp
-It also fills in the structure pointed to by
+The number of clock ticks per second may be determined by calling
+.Xr sysconf 3
+with the
+.Dv _SC_CLK_TCK
+request. It is generally (but not always) between 60 and 1024.
+.Pp
+Note that at the common rate of 100 ticks per second on many
+.Nx
+ports, and with a 32-bit unsigned clock_t, this value first wrapped in 1971.
+.Pp
+The
+.Fn times
+call also fills in the structure pointed to by
 .Fa tp
 with time-accounting information.
 .Pp
@@ -102,9 +111,9 @@
 of the child processes.
 .El
 .Pp
-All times are in
-.Dv CLK_TCK Ns 's
-of a second.
+All times are measured in clock ticks, as defined above. Note that at
+100 ticks per second, and with a 32-bit unsigned clock_t, the values
+wrap after 497 days.
 .Pp
 The times of a terminated child process are included in the
 .Fa tms_cutime
@@ -135,7 +144,8 @@
 .Xr time 1 ,
 .Xr getrusage 2 ,
 .Xr gettimeofday 2 ,
-.Xr wait 2
+.Xr wait 2 ,
+.Xr sysconf 3
 .Sh STANDARDS
 The
 .Fn times



Home | Main Index | Thread Index | Old Index