qtimeout(9F) manual page
Table of Contents
qtimeout - execute a function after a specified length of time
#include
<sys/stream.h>
#include <sys/ddi.h>
int qtimeout( queue_t *q, void (*ftn)(), caddr_t arg,
long ticks );
Solaris DDI specific (Solaris DDI).
- q
- Pointer to STREAMS
queue structure.
- ftn
- Kernel function to invoke when the
time increment expires.
- arg
- Argument to the function.
- ticks
- Number of clock
ticks to wait before the function is called.
The qtimeout()
function schedules the specified function ftn to be called after a specified
time interval. ftn is called with arg as a parameter. Control is immediately
returned to the caller. This is useful when an event is known to occur within
a specific time frame, or when you want to wait for I/O processes when
an interrupt is not available or might cause problems. The exact time interval
over which the timeout takes effect cannot be guaranteed, but the value
given is a close approximation.
The qtimeout() function is tailored to be
used with the enhanced STREAMS
framework interface which is based on the
concept of perimeters. (See mt-streams(9F)
.) qtimeout() schedules the specified
function to execute after entering the perimeters associated with the
queue passed in as the first parameter to qtimeout(). All outstanding timeouts
should be cancelled before a driver closes or module returns.
qprocson(9F)
must be called before calling qtimeout().
Under normal conditions,
an integer timeout identifier is returned.
The qtimeout() function returns
an identifier that may be passed to the quntimeout(9F)
function to cancel
a pending request. Note: No value is returned from the called function.
qtimeout()
can be called from user or interrupt context.
mt-streams(9F)
, qbufcall(9F)
,
qprocson(9F)
, qunbufcall(9F)
, quntimeout(9F)
Table of Contents