Module Name: src Committed By: jruoho Date: Mon May 2 17:01:52 UTC 2011
Modified Files: src/lib/libc/sys: getitimer.2 Log Message: Remove NOTES as it is documented in itimerval(3). Remove #ifdefs from SYNOPSIS (these are visible enough in the body of the text). Use a list for the timers. Improve wording and markup. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/lib/libc/sys/getitimer.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/sys/getitimer.2 diff -u src/lib/libc/sys/getitimer.2:1.24 src/lib/libc/sys/getitimer.2:1.25 --- src/lib/libc/sys/getitimer.2:1.24 Fri Apr 30 04:17:45 2010 +++ src/lib/libc/sys/getitimer.2 Mon May 2 17:01:52 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: getitimer.2,v 1.24 2010/04/30 04:17:45 jruoho Exp $ +.\" $NetBSD: getitimer.2,v 1.25 2011/05/02 17:01:52 jruoho Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)getitimer.2 8.3 (Berkeley) 5/16/95 .\" -.Dd April 30, 2010 +.Dd May 2, 2011 .Dt GETITIMER 2 .Os .Sh NAME @@ -40,9 +40,6 @@ .Lb libc .Sh SYNOPSIS .In sys/time.h -.Fd #define ITIMER_REAL 0 -.Fd #define ITIMER_VIRTUAL 1 -.Fd #define ITIMER_PROF 2 .Ft int .Fn getitimer "int which" "struct itimerval *value" .Ft int @@ -60,10 +57,11 @@ The .Fn setitimer call sets a timer to the specified -.Fa value -(returning the previous value of the timer if +.Fa value , +returning the previous value of the timer if .Fa ovalue -is non-nil). +is not +.Dv NULL . .Pp A timer value is defined by the .Fa itimerval @@ -91,30 +89,28 @@ to 0 causes a timer to be disabled after its next expiration (assuming .Fa it_value is non-zero). -.Pp -Time values smaller than the resolution of the +Note that time values smaller than the resolution of the system clock are rounded up to this resolution (typically 10 milliseconds). .Pp The -.Dv ITIMER_REAL +.Fa which +parameter specifies the type of the timer: +.Bl -tag -width "ITIMER_VIRTUAL " -offset indent +.It Dv ITIMER_REAL timer decrements in real time. A .Dv SIGALRM signal is delivered when this timer expires. -.Pp -The -.Dv ITIMER_VIRTUAL +.It Dv ITIMER_VIRTUAL timer decrements in process virtual time. It runs only when the process is executing. A .Dv SIGVTALRM signal is delivered when it expires. -.Pp -The -.Dv ITIMER_PROF +.It Dv ITIMER_PROF timer decrements both in process virtual time and when the system is running on behalf of the process. It is designed to be used by interpreters in statistically profiling @@ -128,22 +124,6 @@ Because this signal may interrupt in-progress system calls, programs using this timer must be prepared to restart interrupted system calls. -.Sh NOTES -Macros for manipulating time values are defined in the -.In sys/time.h -header; -.Fn timerclear -sets a time value to zero, -.Fn timerisset -tests if a time value is non-zero, -.Fn timercmp -compares two time values, -.Fn timeradd -adds a time value to another time value, -.Fn timersub -computes the time difference between two time values. -For additional details, see -.Xr timeradd 3 . .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 error @@ -167,19 +147,16 @@ .El .Sh SEE ALSO .Xr gettimeofday 2 , -.Xr poll 2 , .Xr select 2 , -.Xr sigaction 2 +.Xr sigaction 2 , +.Xr itimerval 3 , +.Xr timeradd 3 .Sh STANDARDS -The -.Fn getitimer -and -.Fn setitimer -functions conform to +The functions conform to .St -p1003.1-2001 . The later .St -p1003.1-2008 -revision however marked both functions as obsolescent, +revision however marked both as obsolescent, recommending the use of .Xr timer_gettime 2 and