.\" 2005-03-11, mtk, modified pselect() text (it is now a system
.\" call in 2.6.16.
.\"
-.TH SELECT 2 2014-01-31 "Linux" "Linux Programmer's Manual"
+.TH SELECT 2 2015-01-22 "Linux" "Linux Programmer's Manual"
.SH NAME
select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO \-
synchronous I/O multiplexing
waiting until one or more of the file descriptors become "ready"
for some class of I/O operation (e.g., input possible).
A file descriptor is considered ready if it is possible to
-perform the corresponding I/O operation (e.g.,
-.BR read (2))
-without blocking.
+perform a corresponding I/O operation (e.g.,
+.BR read (2)
+without blocking, or a sufficiently small
+.BR write (2)).
.PP
The operation of
.BR select ()
block; in particular, a file descriptor is also ready on end-of-file),
those in
.I writefds
-will be watched to see if a write will not block, and
-those in
+will be watched to see if space is available for write (though a large
+write may still block), and those in
.I exceptfds
will be watched for exceptions.
On exit, the sets are modified in place
.TP
.B EINVAL
.I nfds
-is negative or the value contained within
+is negative or exceeds the
+.BR RLIMIT_NOFILE
+resource limit (see
+.BR getrlimit (2)).
+.TP
+.B EINVAL
+the value contained within
.I timeout
is invalid.
.TP
first appeared in 4.2BSD).
Generally portable to/from
non-BSD systems supporting clones of the BSD socket layer (including
-System V variants).
-However, note that the System V variant typically
+System\ V variants).
+However, note that the System\ V variant typically
sets the timeout variable before exit, but the BSD variant does not.
.PP
.BR pselect ()
and
.BR pselect ().
-Libc4 and libc5 do not have a
+Under glibc 2.0,
.I <sys/select.h>
-header; under glibc 2.0 and later this header exists.
-Under glibc 2.0 it unconditionally gives the wrong prototype for
+gives the wrong prototype for
.BR pselect ().
-Under glibc 2.1 to 2.2.1 it gives
+Under glibc 2.1 to 2.2.1, it gives
.BR pselect ()
when
.B _GNU_SOURCE
is defined.
-Since glibc 2.2.2 the requirements are as shown in the SYNOPSIS.
+Since glibc 2.2.2, the requirements are as shown in the SYNOPSIS.
.SS Multithreaded applications
If a file descriptor being monitored by
.BR select ()
.BR select ().
In summary, any application that relies on a particular behavior
in this scenario must be considered buggy.
-.SS Linux notes
+.\"
+.SS C library/kernel ABI differences
The
.BR pselect ()
interface described in this page is implemented by glibc.
.BR poll (2),
.BR read (2),
.BR recv (2),
+.BR restart_syscall (2),
.BR send (2),
.BR sigprocmask (2),
.BR write (2),
For a tutorial with discussion and examples, see
.BR select_tut (2).
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.