[9] | 1 | .TH SELECT 2 "Jun 9, 2005"
|
---|
| 2 | .UC 4
|
---|
| 3 | .SH NAME
|
---|
| 4 | select, FD_CLR, FD_ISSET, FD_SET, FD_ZERO \- synchronous I/O multiplexing
|
---|
| 5 | .SH SYNOPSIS
|
---|
| 6 | .nf
|
---|
| 7 | .ft B
|
---|
| 8 | #include <sys/select.h>
|
---|
| 9 |
|
---|
| 10 | int select(int \fInfds\fP, fd_set *\fIreadfds\fP, fd_set *\fIwritefds\fP, fd_set *\fIerrorfds\fP, struct timeval *\fItimeout\fP)
|
---|
| 11 |
|
---|
| 12 | void FD_CLR(int \fIfd\fP, fd_set *\fIfdset\fP)
|
---|
| 13 | int FD_ISSET(int \fIfd\fP, fd_set *\fIfdset\fP)
|
---|
| 14 | void FD_SET(int \fIfd\fP, fd_set *\fIfdset\fP)
|
---|
| 15 | void FD_ZERO(fd_set *\fIfdset\fP)
|
---|
| 16 | .ft R
|
---|
| 17 | .fi
|
---|
| 18 | .SH DESCRIPTION
|
---|
| 19 | .B Select
|
---|
| 20 | examines the file descriptors given in the sets
|
---|
| 21 | .IR readfds ,
|
---|
| 22 | .IR writefds ,
|
---|
| 23 | and
|
---|
| 24 | .IR errorfds ,
|
---|
| 25 | up to and including file descriptor
|
---|
| 26 | .IR nfds -1
|
---|
| 27 | , for reading, writing, or exceptional conditions, respectively.
|
---|
| 28 | .B Select
|
---|
| 29 | currently supports regular files, pipes, named pipes,
|
---|
| 30 | inet, and tty file descriptors (including pty).
|
---|
| 31 |
|
---|
| 32 | If the
|
---|
| 33 | .I readfds
|
---|
| 34 | argument is not a null pointer, it points to an object of type fd_set
|
---|
| 35 | that on input specifies the file descriptors to be checked for being
|
---|
| 36 | ready to read, and on output indicates which file descriptors are ready
|
---|
| 37 | to read.
|
---|
| 38 | .I Writefds
|
---|
| 39 | and
|
---|
| 40 | .I errorfds
|
---|
| 41 | have an analogous meaning for file descriptors to be checked for being
|
---|
| 42 | ready to read, respectively have pending exceptional (error) conditions.
|
---|
| 43 |
|
---|