00001
00002
00003
00004
00005 #ifndef __SELECT_H
00006 #define __SELECT_H
00007
00008 #include "setup.h"
00009
00010 #ifdef HAVE_SYS_POLL_H
00011 #include <sys/poll.h>
00012 #endif
00013
00014 #if defined(USE_WINSOCK) && (USE_WINSOCK > 1) && \
00015 defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600)
00016 #undef HAVE_POLL
00017 #define HAVE_POLL 1
00018 #undef HAVE_POLL_FINE
00019 #define HAVE_POLL_FINE 1
00020 #define poll(x,y,z) WSAPoll((x),(y),(z))
00021 #endif
00022
00023 #ifndef HAVE_SYS_POLL_H
00024
00025 #define POLLIN 0x01
00026 #define POLLPRI 0x02
00027 #define POLLOUT 0x04
00028 #define POLLERR 0x08
00029 #define POLLHUP 0x10
00030 #define POLLNVAL 0x20
00031
00032 struct pollfd
00033 {
00034 curl_socket_t fd;
00035 short events;
00036 short revents;
00037 };
00038
00039 #endif
00040
00041 #ifndef POLLRDNORM
00042 #define POLLRDNORM POLLIN
00043 #endif
00044
00045 #ifndef POLLWRNORM
00046 #define POLLWRNORM POLLOUT
00047 #endif
00048
00049 #ifndef POLLRDBAND
00050 #define POLLRDBAND POLLPRI
00051 #endif
00052
00053 int Curl_socket_ready(curl_socket_t readfd, curl_socket_t writefd,
00054 int timeout_ms);
00055
00056 int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms);
00057
00058 #ifdef TPF
00059 int tpf_select_libcurl(int maxfds, fd_set* reads, fd_set* writes,
00060 fd_set* excepts, struct timeval* tv);
00061 #endif
00062
00063 #endif