Open System Services System Calls Reference Manual (G06.25+, H06.03+)

select(2) OSS System Calls Reference Manual
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 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 is reading, writing, or an 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 signals 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), signal 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:
ready for reading
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.
On return, the select() function replaces the original le descriptor sets with the corresponding
le descriptor sets that have a bit set for each le descriptor representing those objects that are
ready for the requested operation. The total number of ready objects represented by set bits in all
the le descriptor sets is returned by the select() function.
76 Hewlett-Packard Company 527186-003