From: art Date: Wed, 23 Jul 2008 11:45:21 +0000 (+0000) Subject: Document the new timeout_add_* functions. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=bc6b638db3e337994bc501daf8a548c80419b3c9;p=openbsd Document the new timeout_add_* functions. --- diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index c10c97c495f..e1082e31046 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.142 2008/06/10 10:31:33 deraadt Exp $ +# $OpenBSD: Makefile,v 1.143 2008/07/23 11:45:21 art Exp $ # $NetBSD: Makefile,v 1.4 1996/01/09 03:23:01 thorpej Exp $ # Makefile for section 9 (kernel function and variable) manual pages. @@ -293,7 +293,10 @@ MLINKS+=time.9 boottime.9 time.9 mono_time.9 time.9 runtime.9 MLINKS+=timeout.9 timeout_add.9 timeout.9 timeout_set.9 \ timeout.9 timeout_pending.9 timeout.9 timeout_del.9 \ timeout.9 timeout_initialized.9 timeout.9 untimeout.9 \ - timeout.9 timeout_triggered.9 + timeout.9 timeout_triggered.9 timeout.9 timeout_add_tv.9 \ + timeout.9 timeout_add_ts.9 timeout.9 timeout_add_bt.9 \ + timeout.9 timeout_add_sec.9 timeout.9 timeout_add_usec.9 \ + timeout.9 timeout_add_nsec.9 MLINKS+=uiomove.9 uio.9 MLINKS+=uvm.9 uvm_init.9 uvm.9 uvm_init_limits.9 uvm.9 uvm_setpagesize.9 \ uvm.9 uvm_swap_init.9 uvm.9 uvm_map.9 uvm.9 uvm_map_pageable.9 \ diff --git a/share/man/man9/timeout.9 b/share/man/man9/timeout.9 index 00c5c4d9735..33d42fb2367 100644 --- a/share/man/man9/timeout.9 +++ b/share/man/man9/timeout.9 @@ -1,4 +1,4 @@ -.\" $OpenBSD: timeout.9,v 1.25 2007/09/14 16:16:08 mk Exp $ +.\" $OpenBSD: timeout.9,v 1.26 2008/07/23 11:45:21 art Exp $ .\" .\" Copyright (c) 2000 Artur Grabowski .\" All rights reserved. @@ -23,7 +23,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: September 14 2007 $ +.Dd $Mdocdate: July 23 2008 $ .Dt TIMEOUT 9 .Os .Sh NAME @@ -49,6 +49,18 @@ .Fn "timeout_initialized" "struct timeout *to" .Ft int .Fn "timeout_triggered" "struct timeout *to" +.Ft void +.Fn "timeout_add_tv" "struct timeout *to" "struct timeval *" +.Ft void +.Fn "timeout_add_ts" "struct timeout *to" "struct timespec *" +.Ft void +.Fn "timeout_add_bt" "struct timeout *to" "struct bintime *" +.Ft void +.Fn "timeout_add_sec" "struct timeout *to" "int sec" +.Ft void +.Fn "timeout_add_usec" "struct timeout *to" "int sec" +.Ft void +.Fn "timeout_add_nsec" "struct timeout *to" "int sec" .Sh DESCRIPTION The .Nm timeout @@ -145,6 +157,19 @@ The and .Fn timeout_del functions clear the triggered state for that timeout. +.Pp +When possible, instead of using +.Fn timeout_add +the functions +.Fn timeout_add_tv , +.Fn timeout_add_ts , +.Fn timeout_add_bt , +.Fn timeout_add_sec , +.Fn timeout_add_usec , +.Fn timeout_add_nsec +should be used. +Those functions add a timeout doing conversion of the time specified +by their respective types. .Sh CODE REFERENCES These functions are implemented in the file .Pa sys/kern/kern_timeout.c .