Open System Services System Calls Reference Manual (G06.28+)

select(2) OSS System Calls Reference Manual
timeout Points to a type timeval structure that species the time to wait for a response
from a call to the select() function. When the timeout parameter is not a null
pointer, the maximum time interval to wait for the select() function to nish is
specied by values stored in space reserved by the type timeval structure
pointed to by the timeout parameter. A timeout value of 0 (zero) is treated as "do
not wait". A timeout value of less than 10 milliseconds is rounded up so that the
timeout value used is at least 10 milliseconds. A
timeout value more than 10
milliseconds is rounded down to the nearest multiple of 10 milliseconds.
The object pointed to by the timeout parameter can be modied after successful
completion of the call.
fd Species a le descriptor.
fdset Points to a le descriptor set.
DESCRIPTION
The select() function checks the status of objects identied by bit masks called le descriptor
sets.
Each le descriptor set consists of an array of bits whose relative position and state represent a
le descriptor and the true or false status for the condition of its corresponding object. An object
is an open le descriptor for an OSS directory (that is, a directory that is not in /G or /E), a
socket, a regular le, a terminal device le, a pipe, or a FIFO.
There is a le descriptor set for reading, for writing, and for pending exceptions. These le
descriptor sets are pointed to by the readfds, writefds, and errorfds parameters, respectively.
When the select() function is called, it checks the le descriptor sets in the range 0 through
nfds-1. If there are le descriptors ready for reading, writing, or that have a pending exception,
the select() function returns a modied le descriptor set.
If no condition is true for any specied le descriptor in any specied le descriptor set, the
select() function blocks until one of these conditions occurs:
A specied condition is true for one of the specied descriptors in one of the specied
sets.
The interval specied by the timeout parameter elapses. If the timeout parameter points
to a structure whose members have the value 0 (zero), process blocking does not occur.
A modied le descriptor set has these characteristics:
It is a selected le descriptor set pointed to by the readfds, writefds, and errorfds param-
eters.
When the function was called, the le descriptor set had at least one bit set that
corresponded to an active le descriptor.
The object represented by the set bit is any of these:
is ready for reading
is ready for writing
has an exception pending
When these conditions exist, a corresponding bit position is set in the returned le
descriptor set pointed to by the readfds, writefds, and errorfds parameters.
76 Hewlett-Packard Company 527186-005