Allocates a per-process interval timer.
#include <sys/time.h> #include <sys/events.h> timer_t gettimerid(TimerType, NotifyType) int TimerType; int NotifyType;
The gettimerid subroutine is used to allocate a per-process interval timer based on the timer with the given timer type. The unique ID is used to identify the interval timer in interval timer requests. (See getinterval subroutine). The particular timer type, the TimerType parameter, is defined in the sys/time.h file and can identify either a systemwide timer or a per-process timer. The mechanism by which the process is to be notified of the expiration of the timer event is the NotifyType parameter, which is defined in the sys/events.h file.
The TimerType parameter represents one of the following timer types:
Interval timers with a notification value of DELIVERY_SIGNAL are inherited across an exec subroutine.
NotifyType | Notifies the process of the expiration of the timer event. |
TimerType | Identifies either a systemwide timer or a per-process timer. |
If the gettimerid subroutine succeeds, it returns a timer_t structure that can be passed to the per-process interval timer subroutines, such as the getinterval subroutine. If an error occurs, the value -1 is returned and errno is set.
If the gettimerid subroutine fails, the value -1 is returned and errno is set to one of the following error codes:
EAGAIN | The calling process has already allocated all of the interval timers associated with the specified timer type for this implementation. |
EINVAL | The specified timer type is not defined. |
These subroutines are part of Base Operating System (BOS) Runtime.
The exec subroutine, fork subroutine, getinterval, incinterval, absinterval, resinc, or resabs subroutine, gettimer, settimer, or restimer subroutine, reltimerid subroutine.
List of Time Data Manipulation Services and Subroutines Overview in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.