/* 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.
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 <config.h>
#include <sys/types.h>
#include "poll.h"
#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;
| 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
}
}