Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
select(2) OSS System Calls Reference Manual
— 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 file
descriptor set pointed to by the readfds, writefds, and errorfds parameters.
On return, the select() function replaces the original file descriptor sets with the corresponding
file descriptor sets that have a bit set for each file descriptor representing those objects that are
ready for the requested operation. The total number of ready objects represented by set bits in all
the file descriptor sets is returned by the select() function.
After a file descriptor set is created, it can be modified with these macros:
FD_CLR(fd,&fdset)
Clears the file descriptor bit specified by the fd parameter in the file descriptor
set pointed to by the fdset parameter.
FD_ISSET(fd,&fdset)
Returns a nonzero value when the file descriptor bit specified by the fd parameter
is set in the file descriptor set pointed to by the fdset parameter. Otherwise, the
value 0 (zero) is returned.
FD_SET(fd,&fdset)
Includes the particular file descriptor bit specified by the fd parameter in the file
descriptor set pointed to by the fdset parameter.
FD_ZERO(&fdset)
Initializes the file descriptor set pointed to by the fdset parameter to a null value.
The behavior of these macros is undefined when the fd parameter has a value less than 0 (zero) or
greater than or equal to FD_SETSIZE.
Use on Guardian Objects
You can use the select() function on regular files (disk files) or EDIT files in /G. Such files are
always ready for selection.
You can use the select() function on an OSS terminal (Telserv or OSSTTY). You cannot use
select() function on any other type of Guardian object.
If select() is called using a file descriptor for a version of the Telserv process or OSSTTY pro-
cess that does not support select(), the call fails, and errno is set to the value of [ENOTSUP].
Use From the Guardian Environment
The select() function is one of a set of functions that have these effects when the first of them is
called from the Guardian environment:
• Two Guardian file system file numbers (not necessarily the next two available) are allo-
cated for the root directory and the current working directory. These file 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.
7−10 Hewlett-Packard Company 527186-023