timer_getoverrun timer_gettime timer_settime - per-process timers (REALTIME)
Lb librt
The
timer_settime ();
system call sets the time until the next expiration of the timer specified
by
Fa timerid
from the
it_value
member of the
Fa value
argument and arms the timer if the
it_value
member of
Fa value
is non-zero.
If the specified timer was already
armed when
timer_settime ();
is called, this call resets the time until next expiration to the value
specified.
If the
it_value
member of
Fa value
is zero, the timer is disarmed.
If the timer is disarmed, then pending signal is removed.
If the flag
TIMER_ABSTIME
is not set in the argument
Fa flags ,
timer_settime ();
behaves as if the time until next expiration is set to
be equal to the interval specified by the
it_value
member of
Fa value .
That is,
the timer expires in
it_value
nanoseconds from when the call is made.
If the flag
TIMER_ABSTIME
is set in the argument
Fa flags ,
timer_settime ();
behaves as if the time until next expiration is set to be equal to the
difference between the absolute time specified by the it_value member of
value and the current value of the clock associated with
Fa timerid .
That is, the timer expires when the clock reaches the value specified by the
it_value
member of
Fa value .
If the specified time has already passed, the
system call succeeds and the expiration notification is made.
The reload value of the timer is set to the value specified by the it_interval member of Fa value . When a timer is armed with a non-zero it_interval a periodic (or repetitive) timer is specified.
Time values that are between two consecutive non-negative integer multiples of the resolution of the specified timer are rounded up to the larger multiple of the resolution. Quantization error will not cause the timer to expire earlier than the rounded time value.
If the argument
Fa ovalue
is not
NULL
the
timer_settime ();
system call stores, in the location referenced by
Fa ovalue ,
a value representing
the previous amount of time before the timer would have expired, or zero if the
timer was disarmed, together with the previous timer reload value.
Timers do not
expire before their scheduled time.
Only a single signal is queued to the process for a given timer at any point in
time.
When a timer for which a signal is still pending expires, no signal is
queued, and a timer overrun will occur.
When a timer expiration signal is
accepted by a process, the
timer_getoverrun ();
system call returns the timer expiration overrun count for the specified timer.
The overrun count returned contains the number of extra timer expirations that
occurred between the time the signal was generated (queued) and when it was
accepted, up to but not including an maximum of
Br q Dv DELAYTIMER_MAX .
If the number of
such extra expirations is greater than or equal to
Br q Dv DELAYTIMER_MAX ,
then the overrun count is set to
Br q Dv DELAYTIMER_MAX .
The value returned by
timer_getoverrun ();
applies to the most recent expiration signal acceptance for the timer.
If no
expiration signal has been delivered for the timer, the return value of
timer_getoverrun ();
is unspecified.
Rv -std timer_gettime timer_settime
These system calls may fail if:
The
timer_settime ();
system call may fail if:
The
timer_gettime ();
and
timer_settime ();
system calls
may fail if:
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |