- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

# include/fakepoll.h

    00001 /* $Id: fakepoll.h,v 1.4 2010-05-12 08:15:27 freddy77 Exp $ */
    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(__VMS)
    00023 #include <time.h> /* FD_SETSIZE is in here */
    00024 #endif
    00025
    00026 #if !defined(FD_SETSIZE)
    00027 # if !defined(OPEN_MAX)
    00028 # error cannot establish FD_SETSIZE
    00029 # endif
    00030 #define FD_SETSIZE OPEN_MAX
    00031 #endif
    00032
    00033 #ifndef _WIN32
    00034 /* poll flags */
    00035 # define POLLIN  0x0001
    00036 # define POLLOUT 0x0004
    00037 # define POLLERR 0x0008
    00038
    00039 /* synonyms */
    00040 # define POLLNORM POLLIN
    00041 # define POLLPRI POLLIN
    00042 # define POLLRDNORM POLLIN
    00043 # define POLLRDBAND POLLIN
    00044 # define POLLWRNORM POLLOUT
    00045 # define POLLWRBAND POLLOUT
    00046
    00047 /* ignored */
    00048 # define POLLHUP 0x0010
    00049 # define POLLNVAL 0x0020
    00050 typedef struct pollfd {
    00051     int fd;             /* file descriptor to poll */
    00052     short events;       /* events of interest on fd */
    00053     short revents;      /* events that occurred on fd */
    00054 } pollfd_t;
    00055
    00056 #else /* Windows */
    00057 /*
    00058  * Windows use different constants then Unix
    00059  * Newer version have a WSAPoll which is equal to Unix poll
    00060  */
    00061 # if !defined(POLLRDNORM) && !defined(POLLWRNORM)
    00062 #  define POLLIN  0x0300
    00063 #  define POLLOUT 0x0010
    00064 #  define POLLERR 0x0001
    00065 #  define POLLRDNORM 0x0100
    00066 #  define POLLWRNORM 0x0010
    00067 typedef struct pollfd {
    00068     SOCKET fd;  /* file descriptor to poll */
    00069     short events;       /* events of interest on fd */
    00070     short revents;      /* events that occurred on fd */
    00071 } pollfd_t;
    00072 # else
    00073 typedef struct pollfd pollfd_t;
    00074 # endif
    00075 #endif
    00076
    00077 int fakepoll(struct pollfd fds[], int nfds, int timeout);
    00078
    00079 #endif

All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines