fakepoll.h 556 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * fakepoll.h
  3. *
  4. * On systems where 'poll' doesn't exist, fake it with 'select'.
  5. *
  6. * Nick Mathewson <nickm@freehaven.net>
  7. */
  8. #ifndef __FAKEPOLL_H
  9. #define __FAKEPOLL_H
  10. #include "orconfig.h"
  11. #ifndef HAVE_POLL_H
  12. #ifndef HAVE_SYS_POLL_H
  13. #define USE_FAKE_POLL
  14. struct pollfd {
  15. int fd;
  16. short events;
  17. short revents;
  18. };
  19. #define POLLIN 0x0001
  20. #define POLLPRI 0x0002
  21. #define POLLOUT 0x0004
  22. #define POLLERR 0x0008
  23. #define POLLHUP 0x0010
  24. #define POLLNVAL 0x0020
  25. int poll(struct pollfd *ufds, unsigned int nfds, int timeout);
  26. #endif
  27. #endif
  28. #endif