[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 1

tstart Kernel Service

Purpose

Submits a timer request.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/timer.h>
void tstart (t)
struct trb *t;

Parameter

t Points to a timer request structure.

Description

The tstart kernel service submits a timer request with the timer request block specified by the t parameter as input. The caller of the tstart kernel service must first call the talloc kernel service to allocate the timer request structure. The caller must then initialize the structure's fields before calling the tstart kernel service.

Once the request has been submitted, the kernel calls the t ->func timer function when the amount of time specified by the t ->timeout.it value has elapsed. The t ->func timer function is called on an interrupt level. Therefore, code for this routine must follow conventions for interrupt handlers.

The tstart kernel service examines the t ->flags field to determine if the timer request being submitted represents an absolute request or an incremental one. An absolute request is a request for a time out at the time represented in the it_value structure. An incremental request is a request for a time out at the time represented by now, plus the time in the it_value structure.

The caller should place time information for both absolute and incremental timers in the itimerstruc_t t.it value substructure. The T_ABSOLUTE absolute request flag is defined in the /usr/include/sys/timer.h file and should be ORed into the t ->flag field if an absolute timer request is desired.

Modifications to the system time are added to incremental timer requests, but not to absolute ones. Consider the user who has submitted an absolute timer request for noon on 12/25/88. If a privileged user then modifies the system time by adding four hours to it, then the timer request submitted by the user still occurs at noon on 12/25/88.

By contrast, suppose it is presently 12 noon and a user submits an incremental timer request for 6 hours from now (to occur at 6 p.m.). If, before the timer expires, the privileged user modifies the system time by adding four hours to it, the user's timer request will then expire at 2200 (10 p.m.).

Execution Environment

The tstart kernel service can be called from either the process or interrupt environment.

Return Values

The tstart service has no return values.

Implementation Specifics

The tstart kernel service is part of Base Operating System (BOS) Runtime.

Related Information

The talloc kernel service, tfree kernel service, tstop kernel service.

Timer and Time-of-Day Kernel Services and Using Fine Granularity Timer Services and Structures in AIX Kernel Extensions and Device Support Programming Concepts.


[ Previous | Next | Contents | Home | Search ]