Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Utilities / cmcurl-7.19.0 / lib / select.h
blobb146c8c8b942b7e6b9cdaadc79530aedb640d976
1 #ifndef __SELECT_H
2 #define __SELECT_H
3 /***************************************************************************
4 * _ _ ____ _
5 * Project ___| | | | _ \| |
6 * / __| | | | |_) | |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
10 * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
12 * This software is licensed as described in the file COPYING, which
13 * you should have received as part of this distribution. The terms
14 * are also available at http://curl.haxx.se/docs/copyright.html.
16 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 * copies of the Software, and permit persons to whom the Software is
18 * furnished to do so, under the terms of the COPYING file.
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
23 * $Id: select.h,v 1.1.1.1 2008-09-23 16:32:05 hoffman Exp $
24 ***************************************************************************/
26 #include "setup.h"
28 #ifdef HAVE_SYS_POLL_H
29 #include <sys/poll.h>
30 #elif defined(HAVE_POLL_H)
31 #include <poll.h>
32 #endif
35 * poll() function on Windows Vista and later is called WSAPoll()
38 #if defined(USE_WINSOCK) && (USE_WINSOCK > 1) && \
39 defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600)
40 # undef HAVE_POLL
41 # define HAVE_POLL 1
42 # undef HAVE_POLL_FINE
43 # define HAVE_POLL_FINE 1
44 # define poll(x,y,z) WSAPoll((x),(y),(z))
45 # if defined(_MSC_VER) && defined(POLLRDNORM)
46 # undef POLLPRI
47 # define POLLPRI POLLRDBAND
48 # define HAVE_STRUCT_POLLFD 1
49 # endif
50 #endif
53 * Definition of pollfd struct and constants for platforms lacking them.
56 #if !defined(HAVE_STRUCT_POLLFD) && \
57 !defined(HAVE_SYS_POLL_H) && \
58 !defined(HAVE_POLL_H)
60 #define POLLIN 0x01
61 #define POLLPRI 0x02
62 #define POLLOUT 0x04
63 #define POLLERR 0x08
64 #define POLLHUP 0x10
65 #define POLLNVAL 0x20
67 struct pollfd
69 curl_socket_t fd;
70 short events;
71 short revents;
74 #endif
76 #ifndef POLLRDNORM
77 #define POLLRDNORM POLLIN
78 #endif
80 #ifndef POLLWRNORM
81 #define POLLWRNORM POLLOUT
82 #endif
84 #ifndef POLLRDBAND
85 #define POLLRDBAND POLLPRI
86 #endif
88 int Curl_socket_ready(curl_socket_t readfd, curl_socket_t writefd,
89 int timeout_ms);
91 int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms);
93 #ifdef TPF
94 int tpf_select_libcurl(int maxfds, fd_set* reads, fd_set* writes,
95 fd_set* excepts, struct timeval* tv);
96 #endif
98 #endif /* __SELECT_H */