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

System Functions (s and S) select(2)
NAME
select - Selects among le descriptors for synchronous input/output multiplexing
LIBRARY
G-series native Guardian processes: system library
G-series native OSS processes: system library
H-series native Guardian processes: implicit libraries
H-series OSS processes: implicit libraries
SYNOPSIS
#include <sys/time.h>
int select(
int nfds,
fd_set *readfds,
fd_set *writefds,
fd_set *errorfds,
struct timeval *timeout);
void FD_CLR(
int fd,
fd_set *fdset);
int FD_ISSET(
int fd,
fd_set *fdset);
void FD_SET(
int fd,
fd_set *fdset);
void FD_ZERO(
fd_set *fdset);
PARAMETERS
nfds Species the range of open le descriptors that might be ready for reading or
writing or that have exceptions pending. The select() function tests le descrip-
tors in the range of 0 (zero) through nfds -1.
The nfds parameter cannot be greater than FD_SETSIZE.
readfds Points to a le descriptor set consisting of le descriptors of objects opened for
reading. When the function is called, this le descriptor set species le descrip-
tors to be checked for being ready to read. Upon return from a successful call,
this le descriptor set species le descriptors that are ready to be read.
writefds Points to a le descriptor set consisting of le descriptors for objects opened for
writing. When the function is called, this le descriptor set species le descrip-
tors to be checked for being ready to write. Upon return from a successful call,
this le descriptor set species le descriptors that are ready to be written.
errorfds Points to a le descriptor set consisting of le descriptors for objects opened for
reading or writing. When the function is called, this le descriptor set species
le descriptors to be checked for having exception conditions pending. Upon
return from a successful call, this le descriptor set species le descriptors that
have exception conditions pending.
527186-005 Hewlett-Packard Company 75