00001
00002 #if !defined(_FAKE_POLL_H) && !defined(HAVE_POLL)
00003 #define _FAKE_POLL_H
00004
00005 #if HAVE_CONFIG_H
00006 #include <config.h>
00007 #endif
00008
00009
00010 #if HAVE_LIMITS_H
00011 #include <limits.h>
00012 #endif
00013
00014 #if HAVE_SYS_SELECT_H
00015 #include <sys/select.h>
00016 #endif
00017
00018 #if defined(WIN32)
00019 #include <winsock2.h>
00020 #endif
00021
00022 #if !defined(FD_SETSIZE)
00023 # if !defined(OPEN_MAX)
00024 # error cannot establish FD_SETSIZE
00025 # endif
00026 #define FD_SETSIZE OPEN_MAX
00027 #endif
00028
00029
00030 #define POLLIN 0x0001
00031 #define POLLOUT 0x0004
00032 #define POLLERR 0x0008
00033
00034
00035 #define POLLNORM POLLIN
00036 #define POLLPRI POLLIN
00037 #define POLLRDNORM POLLIN
00038 #define POLLRDBAND POLLIN
00039 #define POLLWRNORM POLLOUT
00040 #define POLLWRBAND POLLOUT
00041
00042
00043 #define POLLHUP 0x0010
00044 #define POLLNVAL 0x0020
00045
00046 typedef struct pollfd {
00047 int fd;
00048 short events;
00049 short revents;
00050 } pollfd_t;
00051
00052
00053 int fakepoll(struct pollfd fds[], int nfds, int timeout);
00054
00055 #endif