Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

clock_getres(3)

clock_gettime(3)

clock_settime(3)

timer_delete(3)

timer_getres(3)

timer_gettime(3)

timer_settime(3)

timer_create(3)  —  Subroutines

Digital

NAME

timer_create − allocate a per-process timer (P1003.4/D10)

SYNOPSIS

#include <timers.h>

timer_t timer_create (
int clock_id ,
struct sigevent ∗evp) ;

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 number sent to the process on timer expiration. 

DESCRIPTION

The timer_create function allocates a per-process timer using the specified clock as the timing base. The timer_create function returns a timer ID, which is used to identify the timer in timer requests. The timer ID is unique within the calling process for the life of that process. The timer ID is disarmed when first returned from a call to timer_create. 

The evp argument specifies the signal that is sent to the calling process when the timer expires. The signal number is specified in the sigevent structure, which is defined in the <signal.h> header file. DEC OSF/1 does not support the P1003.4/D10 Realtime Signals Extension, so you must specify NULL for the sevt_value member of the sigevent structure. 

If you specify a signal number value for evp that signal is sent to the process on timer expiration. If evp is NULL, then a default signal, SIGALRM, is sent. 

The maximum number of timers supported per process (TIMER_MAX) is defined in the limits.h header file. 

Timers are not inherited across fork or exec calls. 

RETURN VALUES

On a successful call a timer ID, timer_t, is returned.  This timer ID can be passed to the per-process timer calls. 

On an unsuccessful call, a value of −1 is returned and errno is set to indicate that an error occurred. 

ERRORS

The timer_create function fails under the following conditions:

[EMTIMERS] The calling process has already allocated all of the timers it is allowed by this implementation. 

[EINVAL] The specified clock type is not defined. 

[EAGAIN] The system lacks sufficient signal queuing resources to honor the request. 

RELATED INFORMATION

clock_getres(3), clock_gettime(3), clock_settime(3), timer_delete(3), timer_getres(3), timer_gettime(3), timer_settime(3)
 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026