![]() |
![]() |
![]() |
Send an alarm signal
#include <sys/neutrino.h> int TimerAlarm( clockid_t id, const struct _itimer * itime, struct _itimer * otime ); int TimerAlarm_r( clockid_t id, const struct _itimer * itime, struct _itimer * otime );
libc
The TimerAlarm() and TimerAlarm_r() functions are identical except in the way they indicate errors. See the Returns section for details.
These kernel calls set an alarm signal (SIGALRM) to be delivered to the thread waiting on the timer at the time specified by itime. If otime isn't NULL, the old timer trigger time is returned.
The type of timer used to implement the alarm is specified with the id argument.
Alarm requests aren't stacked; only a single SIGALRM may be outstanding on a timer at one time. If TimerAlarm() is called while an alarm is outstanding, the alarm is reset to the new value passed in itime.
If itime is NULL, any previous alarm request is canceled and no new alarm is set.
These calls don't block.
The only difference between these functions is the way they indicate errors:
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
The alarm(), TimerAlarm(), and ualarm() requests aren't "stacked"; only a single SIGALRM generator can be scheduled with these functions. If the SIGALRM signal hasn't been generated, the next call to alarm(), TimerAlarm(), or ualarm() reschedules it.
alarm(), TimerCreate(), ualarm()
![]() |
![]() |
![]() |