Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/t/timeralarm.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/t/timeralarm.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/t/timeralarm.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/t/timeralarm.html on line 8

TimerAlarm(), TimerAlarm_r()

Send an alarm signal

Synopsis:

#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 );

Arguments:

id
The timer type to use to implement the alarm; one of:
itime
NULL, or a pointer to a _itimer structure that specifies the length of time to wait.
otime
NULL, or a pointer to a _itimer structure where the function can store the old timer trigger time.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

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 TimerAlarm() and TimerAlarm_r() functions are identical except in the way they indicate errors. See the Returns section for details.


Note:

Alarm requests aren't stacked; only a single SIGALRM may be outstanding on a timer at one time. If you call TimerAlarm() 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.

Blocking states

These calls don't block.

Returns:

The only difference between these functions is the way they indicate errors:

TimerAlarm()
If an error occurs, -1 is returned and errno is set. Any other value returned indicates success.
TimerAlarm_r()
EOK is returned on success. This function does NOT set errno. If an error occurs, any value in the Errors section may be returned.

Errors:

EAGAIN
All kernel timer entries are in use.
EINVAL
Invalid timer value id.

Classification:

QNX Neutrino

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

Caveats:

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.

See also:

alarm(), setitimer(), TimerCreate(), ualarm()

Clocks, Timers, and Getting a Kick Every So Often chapter of Getting Started with QNX Neutrino

Tick, Tock: Understanding the Neutrino Microkernel's Concept of Time chapter of the QNX Neutrino Programmer's Guide


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/t/timeralarm.html on line 255

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/t/timeralarm.html on line 255