X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fpoll.c;h=50a0803bd903d2786af331ffcbaedd2482120cac;hb=bdc599c7bcdbb9b5c1682c3af8bc22c54325dff9;hp=2278aa8b31a4de43751c01f0906aca005dd579ca;hpb=31f17cf550c7ce208892c83b1792bbe94443ac06;p=gnulib.git diff --git a/lib/poll.c b/lib/poll.c index 2278aa8b3..50a0803bd 100644 --- a/lib/poll.c +++ b/lib/poll.c @@ -1,7 +1,7 @@ /* Emulation for poll(2) Contributed by Paolo Bonzini. - Copyright 2001, 2002, 2003, 2006, 2007 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of gnulib. @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "config.h" +#include #include #include "poll.h" @@ -47,6 +47,11 @@ #define EOVERFLOW EINVAL #endif +/* BeOS does not have MSG_PEEK. */ +#ifndef MSG_PEEK +#define MSG_PEEK 0 +#endif + int poll (pfd, nfd, timeout) struct pollfd *pfd; @@ -125,11 +130,16 @@ poll (pfd, nfd, timeout) | POLLWRNORM | POLLWRBAND))) { maxfd = pfd[i].fd; + + /* Windows use a linear array of sockets (of size FD_SETSIZE). The + descriptor value is not used to address the array. */ +#if defined __CYGWIN__ || (!defined _WIN32 && !defined __WIN32__) if (maxfd > FD_SETSIZE) { errno = EOVERFLOW; return -1; } +#endif } }