0b52c27c067cbabed42bf07b4d5e29e83881bfdd
[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 @item
19 This function fails when the @code{nfds} argument is 0 on some platforms:
20 Interix 3.5.
21 @end itemize
22
23 Portability problems not fixed by Gnulib:
24 @itemize
25 @item
26 When you call @code{select} with a timeout, some implementations modify the
27 timeout parameter so that upon return from the function, it contains the
28 amount of time not slept.  Other implementations leave the timeout parameter
29 unmodified.
30 @item
31 On BeOS, @code{select} can only be called on descriptors created by the
32 @code{socket} function, not on regular file descriptors.
33 @item
34 On Solaris 2.6 and older, @code{select} applied to a file descriptor opened
35 for reading and associated with @code{/dev/null} hangs, waiting for input,
36 when instead it should return immediately.
37 @item
38 On Linux, when some file descriptor refers to a regular file, @code{select}
39 may fail, setting @code{errno} to @code{EBADF}.
40 @end itemize