SIO_select
2-408
C Interface
Syntax
mask = SIO_select(streamtab, nstreams, timeout);
Parameters
SIO_Handle streamtab; /* stream table */
Int
nstreams; /* number of streams */
Uns
timeout;
/* return after this many system clock ticks */
Return Value
Uns
mask;
/* stream ready mask */
Description
SIO_select waits until one or more of the streams in the streamtab[] array
is ready for I/O (that is, it does not block when an I/O operation is
attempted).
streamtab[] is an array of streams where nstreams < 16. The timeout
parameter indicates the number of system clock ticks to wait before a
stream becomes ready. If timeout is 0, SIO_select returns immediately. If
timeout is SYS_FOREVER, SIO_select waits until one of the streams is
ready. Otherwise, SIO_select waits for up to 1 system clock tick less than
timeout due to granularity in system timekeeping.
The return value is a mask indicating which streams are ready for I/O. A
1 in bit position j indicates the stream streamtab[j] is ready.
SIO_select results in a context switch if no streams are ready for I/O.
Internally, SIO_select calls Dxx_ready to determine if the device is ready
for an I/O operation.
SIO_ready is similar to SIO_select, except that it does not block. You can
prevent SIO_select from blocking by setting the timeout to zero, however,
SIO_ready is more efficient in this situation because SIO_select performs
SEM_pend with a timeout of zero. SIO_ready simply polls the stream to
see if the device is ready.
For the SIO_STANDARD model in SIO_INPUT mode only, if stream I/O
has not been started (that is, if SIO_get has not been called), SIO_select
calls Dxx_issue for all empty frames to start the device.
SIO_select
Select a ready device