aboutsummaryrefslogtreecommitdiffstats
path: root/man2/getitimer.2
diff options
context:
space:
mode:
Diffstat (limited to 'man2/getitimer.2')
-rw-r--r--man2/getitimer.234
1 files changed, 17 insertions, 17 deletions
diff --git a/man2/getitimer.2 b/man2/getitimer.2
index 08f6d0d348..1d7d6ca632 100644
--- a/man2/getitimer.2
+++ b/man2/getitimer.2
@@ -29,7 +29,7 @@ and (optionally) at regular intervals after that.
When a timer expires, a signal is generated for the calling process,
and the timer is reset to the specified interval
(if the interval is nonzero).
-
+.PP
Three types of timers\(emspecified via the
.IR which
argument\(emare provided,
@@ -56,14 +56,14 @@ CPU time consumed by the process.
At each expiration, a
.B SIGPROF
signal is generated.
-
+.IP
In conjunction with
.BR ITIMER_VIRTUAL ,
this timer can be used to profile user and system CPU time
consumed by the process.
.LP
A process has only one of each of the three types of timers.
-
+.PP
Timer values are defined by the following structures:
.PD 0
.in +4n
@@ -88,7 +88,7 @@ places the current value of the timer specified by
.IR which
in the buffer pointed to by
.IR curr_value .
-
+.PP
The
.IR it_value
substructure is populated with the amount of time remaining until
@@ -99,7 +99,7 @@ when the timer expires.
If both fields of
.IR it_value
are zero, then this timer is currently disarmed (inactive).
-
+.PP
The
.IR it_interval
substructure is populated with the timer interval.
@@ -119,7 +119,7 @@ is non-NULL,
the buffer it points to is used to return the previous value of the timer
(i.e., the same information that is returned by
.BR getitimer ()).
-
+.PP
If either field in
.IR new_value.it_value
is nonzero,
@@ -127,7 +127,7 @@ then the timer is armed to initially expire at the specified time.
If both fields in
.IR new_value.it_value
are zero, then the timer is disarmed.
-
+.PP
The
.IR new_value.it_interval
field specifies the new interval for the timer;
@@ -177,13 +177,13 @@ on the system timer resolution and on the system load; see
If the timer expires while the process is active (always true for
.BR ITIMER_VIRTUAL ),
the signal will be delivered immediately when generated.
-
+.PP
A child created via
.BR fork (2)
does not inherit its parent's interval timers.
Interval timers are preserved across an
.BR execve (2).
-
+.PP
POSIX.1 leaves the
interaction between
.BR setitimer ()
@@ -193,16 +193,16 @@ and the three interfaces
and
.BR usleep (3)
unspecified.
-
+.PP
The standards are silent on the meaning of the call:
-
+.PP
setitimer(which, NULL, &old_value);
-
+.PP
Many systems (Solaris, the BSDs, and perhaps others)
treat this as equivalent to:
-
+.PP
getitimer(which, &old_value);
-
+.PP
In Linux, this is treated as being equivalent to a call in which the
.I new_value
fields are zero; that is, the timer is disabled.
@@ -217,7 +217,7 @@ Under very heavy loading, an
timer may expire before the signal from a previous expiration
has been delivered.
The second signal in such an event will be lost.
-
+.PP
On Linux kernels before 2.6.16, timer values are represented in jiffies.
If a request is made set a timer with a value whose jiffies
representation exceeds
@@ -232,14 +232,14 @@ approximately 99.42 days.
Since Linux 2.6.16,
the kernel uses a different internal representation for times,
and this ceiling is removed.
-
+.PP
On certain systems (including i386),
Linux kernels before version 2.6.12 have a bug which will produce
premature timer expirations of up to one jiffy under some circumstances.
This bug is fixed in kernel 2.6.12.
.\" 4 Jul 2005: It looks like this bug may remain in 2.4.x.
.\" http://lkml.org/lkml/2005/7/1/165
-
+.PP
POSIX.1-2001 says that
.BR setitimer ()
should fail if a