Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

timer_create(2) [netbsd man page]

TIMER_CREATE(2) 					      BSD System Calls Manual						   TIMER_CREATE(2)

NAME
timer_create -- create a per-process timer LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <time.h> #include <signal.h> int timer_create(clockid_t clockid, struct sigevent * restrict evp, timer_t * restrict timerid); DESCRIPTION
The timer_create() function creates a per-process timer using the clock specified in the clockid argument. If it succeeds, the timer_create() function fills in the timerid argument with an id associated with the timer created that can be used by other timer related calls. The clockid must be a valid clock id as defined in <time.h>. The timer is created in a disarmed state. An optional (non-NULL) struct sigevent argument can be specified by the evp argument. If the evp argument is NULL, then evp->sigev_notify defaults to SIGEV_SIGNAL and evp->sigev_value is set to timerid. Refer to sigevent(3) for more details. NOTES
Timers are not inherited after a fork(2) and are disarmed and deleted by an exec(3). RETURN VALUES
If successful, the timer_create() function returns 0, and fills in the timerid argument with the id of the new timer that was created. Oth- erwise, it returns -1, and sets errno to indicate the error. ERRORS
The timer_create() function will fail if: [EAGAIN] The system is out of resources to satisfy this request, or the process has created all the timers it is allowed. [EINVAL] The argument clockid is not a valid clock id. SEE ALSO
clock_getres(2), clock_gettime(2), clock_settime(2), timer_delete(2), timer_getoverrun(2), timer_gettime(2), timer_settime(2) STANDARDS
IEEE Std 1003.1b-1993 (``POSIX.1''), IEEE Std 1003.1i-1995 (``POSIX.1'') BSD
May 19, 2010 BSD

Check Out this Related Man Page

timer_create(3) 					     Library Functions Manual						   timer_create(3)

NAME
timer_create - Allocates a per-process timer LIBRARY
Realtime Library (librt.so, librt.a) SYNOPSIS
#include <signal.h> #include <time.h> int timer_create ( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ); PARAMETERS
clock_id The type of clock on which the timer is based. The CLOCK_REALTIME clock is supported. *evp A pointer to a sigevent structure, which defines the signal sent to the process on timer expiration. *timerid A pointer to the timer ID returned by the call to the timer_create function. DESCRIPTION
The timer_create function allocates a per-process timer using the specified clock as the timing base. The timer_create function returns timer_id, which identifies the timer in timer requests. The timer ID is unique within the calling process until the timer is deleted. The timer is unarmed when first returned from a call to timer_create. To arm the timer, use the timer_settime function. The evp argument, if non-NULL, points to a sigevent structure, which defines the asynchronous notification that occurs when the timer expires. If the sigev_notify member of evp is SIGEV_SIGNAL, the structure must contain the signal number and data value to send to the process when the timer expires. If the sigev_notify member is SIGEV_NONE, no notification is sent. SIGALRM is the default signal for CLOCK_REALTIME if the evp argument is NULL. The maximum number of timers supported per process (TIMER_MAX) is defined in the <sys/rt_limits.h> header file, which is indirectly included through <time.h>. Timers are not inherited across fork calls. An exec call disarms and deletes a timer. RETURN VALUES
Upon successful completion, a value of 0 (zero) is returned. The timer_create function also returns, in timerid, a pointer to the timer ID that has been created. An unsuccessful call returns -1, and errno is set to indicate the error type. ERRORS
The timer_create function fails under the following conditions: [EAGAIN] The system lacks sufficient signal queuing resources to honor the request. The calling process has already created all of the timers it is allowed. [EINVAL] The specified clock ID is not defined. RELATED INFORMATION
Functions: clock_getres(3), clock_gettime(3), clock_settime(3), timer_delete(3), timer_gettime(3), timer_settime(3) Guide to Realtime Programming delim off timer_create(3)
Man Page