Open System Services System Calls Reference Manual (G06.25+, H06.03+)
System Functions (s and S) select(2)
NAME
select - Selects among file descriptors for synchronous input/output multiplexing
LIBRARY
G-series native OSS processes: system library
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 number of open file descriptors that might be ready for reading or
writing or that have exceptions pending. 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 that have an exception pending. When the function is called,
this file descriptor set specifies file descriptors to be checked for having error
conditions pending. Upon return from a successful call, this file descriptor set
specifies file descriptors that have error conditions pending.
timeout Points to a type timeval structure that specifies the time to wait for a response
from a call to the select() function. When the timeout parameter is not a null
pointer, the maximum time interval to wait for the select() function to finish is
specified by values stored in space reserved by the type timeval structure
pointed to by the timeout parameter.
The object pointed to by the timeout parameter can be modified after successful
527186-003 Hewlett-Packard Company 7−5