summaryrefslogtreecommitdiffhomepage
path: root/src/mypoll.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mypoll.h')
-rw-r--r--src/mypoll.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mypoll.h b/src/mypoll.h
index 114c0f8..a336680 100644
--- a/src/mypoll.h
+++ b/src/mypoll.h
@@ -1,21 +1,28 @@
#ifndef MYPOLL_H
#define MYPOLL_H
-#include <sys/select.h>
+#include "config.h"
#ifdef HAVE_POLL_H
+
#include <poll.h>
typedef struct pollfd pollfd_struct;
+
+#define MYPOLL_READ POLLIN
+#define MYPOLL_WRITE POLLOUT
+
#else
+
+#include <sys/select.h>
typedef struct mypollfd {
int fd;
short events;
short revents;
} pollfd_struct;
-#endif
#define MYPOLL_READ (1<<1)
#define MYPOLL_WRITE (1<<2)
+#endif
int mypoll(pollfd_struct* fds, int nfds, int timeout);