memcapable: fix logic error
[awesomized/libmemcached] / libmemcached / poll.h
1 /* LibMemcached
2 * Copyright (C) 2013 Data Differential, http://datadifferential.com/
3 * Copyright (C) 2010 Brian Aker, Trond Norbye
4 * All rights reserved.
5 *
6 * Use and distribution licensed under the BSD license. See
7 * the COPYING file in the parent directory for full text.
8 *
9 * Summary: Implementation of poll by using select
10 *
11 */
12
13 #pragma once
14
15 #if defined(_WIN32)
16
17 #include <winsock2.h>
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 typedef struct pollfd
24 {
25 #if defined(_WIN32)
26 SOCKET fd;
27 #else
28 int fd;
29 #endif
30 short events;
31 short revents;
32 } pollfd_t;
33
34 typedef int nfds_t;
35
36 #define POLLIN 0x0001
37 #define POLLOUT 0x0004
38 #define POLLERR 0x0008
39 #define POLLHUP 0x010 /* Hung up. */
40 #define POLLNVAL 0x020 /* Invalid polling request. */
41
42 int poll(struct pollfd fds[], nfds_t nfds, int tmo);
43
44 #ifdef __cplusplus
45 }
46 #endif
47
48 #endif // defined(_WIN32)