UALARM(3) | Library Functions Manual | UALARM(3)

# NAME

`ualarm` — schedule high resolution SIGALRM delivery

# SYNOPSIS

`#include <unistd.h>`

useconds_t
`ualarm`(useconds_t microseconds, useconds_t interval);

# DESCRIPTION

This is a simplified interface to setitimer(2).

The `ualarm`() function schedules the `SIGALRM` signal for delivery to the calling process after at least the given number of microseconds have elapsed. If interval is non-zero, the `SIGALRM` signal is scheduled for redelivery to the calling process every interval microseconds thereafter.

If an alarm is already pending, an additional call to `ualarm`() supersedes the prior call.

If microseconds is zero, any pending alarm is cancelled and the value of interval is ignored.

# RETURN VALUES

The `ualarm`() function returns the number of microseconds remaining until the next alarm is scheduled for delivery, or zero if no alarm is pending.

# SEE ALSO

setitimer(2), sigaction(2), sigsuspend(2), alarm(3), signal(3), sleep(3), usleep(3)

# STANDARDS

The `ualarm`() function conforms to X/Open Portability Guide Issue 4, Version 2 (“XPG4.2”).

# HISTORY

The `ualarm`() function first appeared in 4.3BSD.

# CAVEATS

The `ualarm`() function is implemented with the per-process `ITIMER_REAL` timer described in setitimer(2). Use of both `ualarm`() and setitimer(2) in the same program may yield confusing behavior.

August 1, 2023 | Debian