diff options
-rw-r--r-- | lib/libc/sys/Makefile.inc | 7 | ||||
-rw-r--r-- | lib/libc/sys/getitimer.2 | 68 |
2 files changed, 50 insertions, 25 deletions
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index dc754ba2bf7..b547b4927e8 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.39 2000/11/16 20:29:55 provos Exp $ +# $OpenBSD: Makefile.inc,v 1.40 2000/12/23 03:04:34 deraadt Exp $ # $NetBSD: Makefile.inc,v 1.35 1995/10/16 23:49:07 jtc Exp $ # @(#)Makefile.inc 8.1 (Berkeley) 6/17/93 @@ -200,6 +200,11 @@ MLINKS+=clock_gettime.2 clock_getres.2 MLINKS+=fhopen.2 fhstat.2 fhopen.2 fhstatfs.2 MLINKS+=getgid.2 getegid.2 MLINKS+=getitimer.2 setitimer.2 +MLINKS+=getitimer.2 timeradd.3 +MLINKS+=getitimer.2 timerclear.3 +MLINKS+=getitimer.2 timercmp.3 +MLINKS+=getitimer.2 timerisset.3 +MLINKS+=getitimer.2 timersub.3 MLINKS+=getlogin.2 setlogin.2 MLINKS+=getpgrp.2 getpgid.2 MLINKS+=getpid.2 getppid.2 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 |