1 /* Header for poll(2) emulation
2 Contributed by Paolo Bonzini.
4 Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
6 This file is part of gnulib.
8 gnulib is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published
10 by the Free Software Foundation; either version 2.1, or (at your option)
13 gnulib is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16 License for more details.
18 You should have received a copy of the GNU Lesser General Public License
19 along with gnulib; see the file COPYING.LIB. If not, write to the Free
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
27 /* fake a poll(2) environment */
28 #define POLLIN 0x0001 /* any readable data available */
29 #define POLLPRI 0x0002 /* OOB/Urgent readable data */
30 #define POLLOUT 0x0004 /* file descriptor is writeable */
31 #define POLLERR 0x0008 /* some poll error occurred */
32 #define POLLHUP 0x0010 /* file descriptor was "hung up" */
33 #define POLLNVAL 0x0020 /* requested events "invalid" */
34 #define POLLRDNORM 0x0040
35 #define POLLRDBAND 0x0080
36 #define POLLWRNORM 0x0100
37 #define POLLWRBAND 0x0200
41 int fd; /* which file descriptor to poll */
42 short events; /* events we are interested in */
43 short revents; /* events found on return */
46 typedef unsigned long nfds_t;
48 extern int poll (struct pollfd *pfd, nfds_t nfd, int timeout);
50 /* Define INFTIM only if doing so conforms to POSIX. */
51 #if !defined (_POSIX_C_SOURCE) && !defined (_XOPEN_SOURCE)