execute a function after a specified length of time
Synopsis (Not in current DDI version)
int timeout(void (*fn)(), caddr_t arg, long ticks);
timeout schedules the specified function to be
called after the time interval specified by ticks.
arg will be passed as the only argument to function fn.
The timeout call returns immediately without waiting for the
specified function to execute.
Function to execute when the time increment expires.
The function specified by fn runs in interrupt
context in HDK Technical Reference
and must not lower the interrupt priority
below that specified by the plhi argument."
fn will be run at some point
after the time interval expires.
Like a device interrupt (see
it may need to be deferred
until the interrupt priority is dropped
to a sufficiently low level.
Timer callback functions are only run
when the interrupt priority level is plbase;
they never interrupt device interrupt handlers.
Argument to the function.
Number of clock ticks to wait before the function is called.
The length of time before the function is called is not guaranteed to be
exactly equal to the requested time, but will be at least ticks
clock ticks in length.
If ticks specifies the value zero,
this implies that the function should be run as soon as possible.
If the function specified by fn is successfully scheduled,
returns an identifier that can be passed to the
function to cancel the request.
If the function could not be scheduled
(because the timeout table is full),
the following panic message results:
PANIC: Timeout table overflow
Drivers should be careful to cancel any pending timeout functions
that access data structures before these structures
are de-initialized or deallocated.
Context and synchronization
Non-blockable, interrupt, user, or blockable
function page for an example of timeout.
1, 2, 3, 4, 5, 5mp, 6, 6mp
Differences between versions
Beginning with DDI version 7
(and supported beginning with DDI version 3), the
function replaces the
returns an error instead of causing a panic
when no more space is available,
so drivers can handle the error,
which improves system reliability and availability.
also allows the driver
to select an interrupt priority other than plhi.
SCO OpenServer provides the
function, which is similar to the DDI
function, although the casting of the arguments are different.
SCO OpenServer ODDI compatibility
ODDI drivers use the
function for all timeouts.
UDI drivers use
in place of
in place of
is similar to
with the TO_PERIODIC flag.
``Timeouts'' in HDK Technical Reference
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005