a9aa263f0b43030839a3834d635bb2f44a624e24
[gnulib.git] / doc / posix-functions / select.texi
1 @node select
2 @section @code{select}
3 @findex select
4
5 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/select.html}
6
7 Gnulib module: select
8
9 Portability problems fixed by Gnulib:
10 @itemize
11 @item
12 On Windows platforms (excluding Cygwin), @code{select} can only be
13 called on descriptors created by the @code{socket} function, not on regular
14 file descriptors.
15 @item
16 On Windows platforms (excluding Cygwin), error codes for @code{accept} are not
17 placed in @code{errno}, and @code{WSAGetLastError} must be used instead.
18 @end itemize
19
20 Portability problems not fixed by Gnulib:
21 @itemize
22 @item
23 When you call @code{select} with a timeout, some implementations modify the
24 timeout parameter so that upon return from the function, it contains the
25 amount of time not slept.  Other implementations leave the timeout parameter
26 unmodified.
27 @item
28 On BeOS, @code{select} can only be called on descriptors created by the
29 @code{socket} function, not on regular file descriptors.
30 @item
31 On Solaris 2.6 and older, @code{select} applied to a file descriptor opened
32 for reading and associated with @code{/dev/null} hangs, waiting for input,
33 when instead it should return immediately.
34 @item
35 On Linux, when some file descriptor refers to a regular file, @code{select}
36 may fail, setting @code{errno} to @code{EBADF}.
37 @end itemize