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

System Functions (s and S) select(2)
After a le descriptor set is created, it can be modied with these macros:
FD_CLR(fd,&fdset)
Clears the le descriptor bit specied by the fd parameter in the le descriptor
set pointed to by the fdset parameter.
FD_ISSET(fd,&fdset)
Returns a nonzero value when the le descriptor bit specied by the fd parameter
is set in the le descriptor set pointed to by the fdset parameter. Otherwise, the
value 0 (zero) is returned.
FD_SET(fd,&fdset)
Includes the particular le descriptor bit specied by the fd parameter in the le
descriptor set pointed to by the fdset parameter.
FD_ZERO(&fdset)
Initializes the le descriptor set pointed to by the fdset parameter to a null value.
The behavior of these macros is undened when the fd parameter has a value less than 0 (zero) or
greater than or equal to FD_SETSIZE.
Use on Guardian Objects
The select() function can be used on regular les (disk les) or EDIT les in /G. Such les are
always ready for selection.
The select() function can be used on a Telserv or OSSTTY terminal process. The select() func-
tion cannot be used on any other type of Guardian object.
Use From the Guardian Environment
The select() function is one of a set of functions that have these effects when the rst of them is
called from the Guardian environment:
Two Guardian le system le numbers (not necessarily the next two available) are allo-
cated for the root directory and the current working directory. These le numbers cannot
be closed by calling the Guardian FILE_CLOSE_ procedure.
The current working directory is assigned from the VOLUME attribute of the Guardian
environment =_DEFAULTS DEFINE.
The use of static memory by the process increases slightly.
These effects occur only when the rst of the set of functions is called. The effects are not cumu-
lative.
NOTES
The select() function cannot be used on terminal device les (ttys) in the HP implementation.
Beginning with the G06.26 release version update (RVU), FD_SETSIZE was increased. Appli-
cations that use a variable select() limit based on the highest numbered le descriptor run
corrrectly on both prior and subsequent RVUs and benet from the higher limit on subsequent
RVUs.
Applications that use a xed select() limit run on both prior and subsequent RVUs if compiled
on prior RVUs but only run on subsequent RVUs if compiled on a subsequent RVU.
Applications that mix select()-related object modules from prior and subsequent RVUs are
unsafe because the select() le descriptor bit arrays have different size declarations in the RVUs.
To avoid application failures, select()-related object modules should be compiled using a con-
sistent set of select() denitions.
527186-003 Hewlett-Packard Company 77