Open System Services System Calls Reference Manual (G06.28+, H06.05+)
System Functions (s and S) select(2)
NAME
select - Selects among file 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 Specifies the range of open file descriptors that might be ready for reading or
writing or that have exceptions pending. The select() function tests file descrip-
tors in the range of 0 (zero) through nfds -1.
The nfds parameter cannot be greater than FD_SETSIZE.
readfds Points to a file descriptor set consisting of file descriptors of objects opened for
reading. When the function is called, this file descriptor set specifies file descrip-
tors to be checked for being ready to read. Upon return from a successful call,
this file descriptor set specifies file descriptors that are ready to be read.
writefds Points to a file descriptor set consisting of file descriptors for objects opened for
writing. When the function is called, this file descriptor set specifies file descrip-
tors to be checked for being ready to write. Upon return from a successful call,
this file descriptor set specifies file descriptors that are ready to be written.
errorfds Points to a file descriptor set consisting of file descriptors for objects opened for
reading or writing. When the function is called, this file descriptor set specifies
file descriptors to be checked for having exception conditions pending. Upon
return from a successful call, this file descriptor set specifies file descriptors that
have exception conditions pending.
527186-007 Hewlett-Packard Company 7−5