diff options
Diffstat (limited to 'src/mypoll.h')
-rw-r--r-- | src/mypoll.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mypoll.h b/src/mypoll.h new file mode 100644 index 0000000..114c0f8 --- /dev/null +++ b/src/mypoll.h @@ -0,0 +1,22 @@ +#ifndef MYPOLL_H +#define MYPOLL_H + +#include <sys/select.h> + +#ifdef HAVE_POLL_H +#include <poll.h> +typedef struct pollfd pollfd_struct; +#else +typedef struct mypollfd { + int fd; + short events; + short revents; +} pollfd_struct; +#endif + +#define MYPOLL_READ (1<<1) +#define MYPOLL_WRITE (1<<2) + +int mypoll(pollfd_struct* fds, int nfds, int timeout); + +#endif |