semver: 1.0 -> 1
[m6w6/libmemcached] / src / p9y / poll.hpp
1 #pragma once
2
3 #include "libmemcached-1/platform.h"
4
5 #if defined HAVE_SYS_POLL_H
6 # include <sys/poll.h>
7 #elif defined HAVE_POLL_H
8 # include <poll.h>
9 #elif defined _WIN32
10 # define poll WSAPoll
11 typedef int nfds_t;
12 #else
13
14 # define P9Y_NEED_POLL
15
16 # ifdef __cplusplus
17 extern "C" {
18 # endif
19
20 typedef struct pollfd {
21 # if defined(_WIN32)
22 SOCKET fd;
23 # else
24 int fd;
25 # endif
26 short events;
27 short revents;
28 } pollfd_t;
29
30 typedef int nfds_t;
31
32 # define POLLIN 0x0001
33 # define POLLOUT 0x0004
34 # define POLLERR 0x0008
35 # define POLLHUP 0x010 /* Hung up. */
36 # define POLLNVAL 0x020 /* Invalid polling request. */
37
38 int poll(struct pollfd fds[], nfds_t nfds, int tmo);
39
40 # ifdef __cplusplus
41 }
42 # endif
43
44 #endif