X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fselect.c;h=8496c1501603d08a9f7ff66dbb565777e1abb265;hb=31d3154399f8c679ba23afb0f6bef03b73d4c741;hp=33e5f734fe6b885070d82967ee76be9d415fa125;hpb=677ecea7c1d134231e429bb3bfcd83e2dbd82cf2;p=gnulib.git diff --git a/lib/select.c b/lib/select.c index 33e5f734f..8496c1501 100644 --- a/lib/select.c +++ b/lib/select.c @@ -1,7 +1,7 @@ /* Emulation for select(2) Contributed by Paolo Bonzini. - Copyright 2008 Free Software Foundation, Inc. + Copyright 2008-2009 Free Software Foundation, Inc. This file is part of gnulib. @@ -23,6 +23,8 @@ #include #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Native Win32. */ + #include #include #include @@ -420,4 +422,25 @@ rpl_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds, return rc; } -#endif /* Native Win32. */ +#else /* ! Native Win32. */ + +#include + +#undef select + +int +rpl_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds, + struct timeval *timeout) +{ + /* Interix 3.5 has a bug: it does not support nfds == 0. */ + if (nfds == 0) + { + nfds = 1; + rfds = NULL; + wfds = NULL; + xfds = NULL; + } + return select (nfds, rfds, wfds, xfds, timeout); +} + +#endif