STREAMS_TIMEOUT(D3X)STREAMS_TIMEOUT(D3X)NAMESTREAMS_TIMEOUT - synchronize timeout with STREAMS mechanism
SYNOPSIS
#include <strmp.h>
toid_t STREAMS_TIMEOUT(strtimeoutfunc_t func, void *arg, int time);
toid_t STREAMS_TIMEOUT1(strtimeoutfunc_t func, void *arg, int time, void
*arg1);
toid_t STREAMS_TIMEOUT2(strtimeoutfunc_t func, void *arg, int time, void
*arg1, void *arg2);
DESCRIPTION
The STREAMS_TIMEOUT macros provide writers of STREAMS device drivers and
modules with an interface for synchronizing timeouts with the STREAMS
mechanism on multi-processor IRIX systems. Under IRIX, it is not
permitted to call STREAMS interface routines (e.g., allocb(), putq(),
qenable()) or otherwise manipulate STREAMS data structures from a
function called via a timeout without first synchronizing with the
underlying STREAMS mechanism.
Failure to properly synchronize could result in corrupted data structures
and kernel panics.
The STREAMS_TIMEOUT interfaces arrange for func to be called in time/HZ
seconds, and guarantee that it will be properly synchronized with the
STREAMS mechanism.
One, two or three arguments may be passed to func by using
STREAMS_TIMEOUT, STREAMS_TIMEOUT1 or STREAMS_TIMEOUT2 respectively.
The STREAMS_TIMEOUT interfaces do not guarantee the spl level that func
will run at. It is the responsibility of the driver or module writer to
explicitly set the desired spl level within func. However, the driver or
module writer "must not" under any circumstances set the spl level to
spl0 within func.
Diagnostics
The STREAMS_TIMEOUT interfaces return a positive toid_t on success. This
toid_t value may be used by a subsequent call to untimeout() to cancel
the timeout. If an error is detected while setting the timeout, a toid_t
of 0 will be returned and no timeout will be set.
See Also
streams_interrupt(D3X), untimeout(D3), IRIX Device Driver Programming
Guide
Page 1