Source-Changes-HG archive

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

[src/trunk]: src/share/man/man9 In addition to mstohz(9), document also hztoms.



details:   https://anonhg.NetBSD.org/src/rev/c56b487ab4ad
branches:  trunk
changeset: 752578:c56b487ab4ad
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Mon Mar 01 17:21:02 2010 +0000

description:
In addition to mstohz(9), document also hztoms.

diffstat:

 share/man/man9/Makefile |   3 ++-
 share/man/man9/mstohz.9 |  26 ++++++++++++++++++--------
 2 files changed, 20 insertions(+), 9 deletions(-)

diffs (81 lines):

diff -r db5df3b822b7 -r c56b487ab4ad share/man/man9/Makefile
--- a/share/man/man9/Makefile   Mon Mar 01 17:20:44 2010 +0000
+++ b/share/man/man9/Makefile   Mon Mar 01 17:21:02 2010 +0000
@@ -1,4 +1,4 @@
-#       $NetBSD: Makefile,v 1.316 2010/02/12 01:00:22 dyoung Exp $
+#       $NetBSD: Makefile,v 1.317 2010/03/01 17:21:02 jruoho Exp $
 
 #      Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -414,6 +414,7 @@
        microuptime.9 getmicrouptime.9 \
        microuptime.9 nanouptime.9 \
        microuptime.9 getnanouptime.9
+MLINKS+=mstohz.9 hztoms.9
 MLINKS+=mutex.9 mutex_init.9 mutex.9 mutex_destroy.9 mutex.9 mutex_enter.9 \
        mutex.9 mutex_exit.9 mutex.9 mutex_tryenter.9 mutex.9 mutex_owned.9 \
        mutex.9 mutex_spin_enter.9 mutex.9 mutex_spin_exit.9
diff -r db5df3b822b7 -r c56b487ab4ad share/man/man9/mstohz.9
--- a/share/man/man9/mstohz.9   Mon Mar 01 17:20:44 2010 +0000
+++ b/share/man/man9/mstohz.9   Mon Mar 01 17:21:02 2010 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: mstohz.9,v 1.6 2009/10/19 18:41:09 bouyer Exp $
+.\"    $NetBSD: mstohz.9,v 1.7 2010/03/01 17:21:02 jruoho Exp $
 .\"
 .\" Copyright (c) 2002 Manuel Bouyer.
 .\"
@@ -24,24 +24,29 @@
 .\" SUCH DAMAGE.
 .\"
 .\"
-.Dd April 4, 2002
+.Dd February 10, 2010
 .Dt MSTOHZ 9
 .Os
 .Sh NAME
 .Nm mstohz
-.Nd convert milliseconds to system clock ticks
+.Nd convert between milliseconds and system clock ticks
 .Sh SYNOPSIS
 .In sys/param.h
 .Ft int
 .Fn mstohz "int ms"
+.Ft int
+.Fn hztoms "int hz"
 .Sh DESCRIPTION
 .Nm
 can be used to convert time in milliseconds to system clock ticks, as used
 by the
 .Xr callout 9
 facility, in an integer-overflow safe way.
+Conversely,
+.Fn hztoms
+converts system clock ticks to milliseconds.
 .Pp
-This function is implemented as a define in the
+These macros are defined in the
 .Em \*[Lt]sys/param.h\*[Gt]
 header.
 Individual ports can have a processor-specific, more efficient
@@ -49,12 +54,17 @@
 .Em \*[Lt]machine/param.h\*[Gt]
 header as a define.
 .Sh RETURN VALUES
-The return value is the number of clock ticks for the specified value.
+The return value is either the number of clock ticks or milliseconds
+for the specified value.
 .Sh SEE ALSO
 .Xr callout 9
 .Sh BUGS
-The machine-independent
+Neither
 .Fn mstohz
-function does not make use of expensive 64-bit integer arithmetic, so
-the result will be rounded down to one second if the parameter is larger
+nor
+.Fn hztoms
+make use of expensive 64-bit integer arithmetic.
+The result from
+.Fn mstohz
+will be rounded down to one second if the parameter is larger
 than 131072 milliseconds.



Home | Main Index | Thread Index | Old Index