select.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef __SELECT_H
  2. #define __SELECT_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2006, Daniel Stenberg, <[email protected]>, et al.
  11. *
  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.
  15. *
  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.
  19. *
  20. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  21. * KIND, either express or implied.
  22. *
  23. * $Id$
  24. ***************************************************************************/
  25. #ifdef HAVE_SYS_POLL_H
  26. #include <sys/poll.h>
  27. #else
  28. #ifndef POLLIN
  29. #define POLLIN 0x01
  30. #define POLLPRI 0x02
  31. #define POLLOUT 0x04
  32. #define POLLERR 0x08
  33. #define POLLHUP 0x10
  34. #define POLLNVAL 0x20
  35. struct pollfd
  36. {
  37. curl_socket_t fd;
  38. short events;
  39. short revents;
  40. };
  41. #endif
  42. #endif
  43. #define CSELECT_IN 0x01
  44. #define CSELECT_OUT 0x02
  45. #define CSELECT_ERR 0x04
  46. int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms);
  47. int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms);
  48. #ifdef TPF
  49. int tpf_select_libcurl(int maxfds, fd_set* reads, fd_set* writes,
  50. fd_set* excepts, struct timeval* tv);
  51. #endif
  52. #endif