summaryrefslogtreecommitdiff
path: root/lib/libc/sys/getitimer.2
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2000-12-23 03:04:35 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2000-12-23 03:04:35 +0000
commit69f25e8f003f598472fe9aceef96a0ddb1fe6841 (patch)
treedfab020593165cac1a65f4bc08d2a471cf39829c /lib/libc/sys/getitimer.2
parent6e1d6e7bd91b5200923c56737ba3ea48885e7b9a (diff)
create proper docs for timer{add,clear,sub,isset,cmp}
Diffstat (limited to 'lib/libc/sys/getitimer.2')
-rw-r--r--lib/libc/sys/getitimer.268
1 files changed, 44 insertions, 24 deletions
diff --git a/lib/libc/sys/getitimer.2 b/lib/libc/sys/getitimer.2
index 320d3d269f8..a5f7869e7b8 100644
--- a/lib/libc/sys/getitimer.2
+++ b/lib/libc/sys/getitimer.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: getitimer.2,v 1.12 2000/10/18 05:12:09 aaron Exp $
+.\" $OpenBSD: getitimer.2,v 1.13 2000/12/23 03:04:34 deraadt Exp $
.\" $NetBSD: getitimer.2,v 1.6 1995/10/12 15:40:54 jtc Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
@@ -51,6 +51,16 @@
.Fn getitimer "int which" "struct itimerval *value"
.Ft int
.Fn setitimer "int which" "const struct itimerval *value" "struct itimerval *ovalue"
+.Ft void
+.Fn timerclear "struct timeval *"
+.Ft int
+.Fn timerisset "struct timeval *"
+.Ft int
+.Fn timercmp "struct timeval *a, struct timeval *b, CMP"
+.Ft void
+.Fn timersub "struct timeval *a, struct timeval *b, struct timeval *res"
+.Ft void
+.Fn timeradd "struct timeval *a, struct timeval *a, struct timeval *res"
.Sh DESCRIPTION
The system provides each process with three interval timers,
defined in
@@ -130,33 +140,43 @@ signal is delivered.
Because this signal may interrupt in-progress
system calls, programs using this timer must be prepared to
restart interrupted system calls.
-.Sh NOTES
-Five macros for manipulating time values are defined in
-.Ao Pa sys/time.h Ac :
.Pp
-.Bl -tag -width xxxx
-.It Fn timerclear "struct timeval *"
-Sets a time value to zero.
-.It Fn timerisset "struct timeval *"
-Tests if a time value is non-zero.
-.It Fn timercmp "struct timeval *a, struct timeval *b, CMP"
-Compares two time values in the form
-.Va a
+The remaining five functions are in fact macros for manipulating time
+values, defined in
+.Ao Pa sys/time.h Ac .
+.Pp
+.Fn timerclear "a"
+sets the time value in
+.Fa a
+to zero.
+.Pp
+.Fn timerisset "a"
+tests if the time value in
+.Fa a
+is non-zero.
+.Pp
+.Fn timercmp "a, b, CMP"
+compares two time values in the form
+.Fa a
CMP
-.Va b Ns ,
-where CMP is <, =, or >
-(beware that >= and <= do not work with this macro).
-.It Fn timersub "struct timeval *a, struct timeval *b, struct timeval *res"
-Subtracts
-.Va a
+.Fa b Ns ,
+where
+.Fa CMP
+is <, =, or > .
+Beware that >= and <= do not work with this macro.
+.Pp
+.Fn timersub "a, b, res"
+subtracts
+.Fa a
-
-.Va b
+.Fa b
and stores the result in
-.Va res Ns .
-.It Fn timeradd "struct timeval *a, struct timeval *a, struct timeval *res"
-Adds two timers and stores the result in
-.Va res Ns .
-.El
+.Fa res Ns .
+.Pp
+.Fn timeradd "a, a, res"
+adds two timers and stores the result in
+.Fa res Ns .
+.Pp
.Sh RETURN VALUES
If the calls succeed, a value of 0 is returned.
If an error occurs, the value \-1 is returned, and a more precise