fakepoll.h 696 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. /*
  9. * Changes :
  10. * $Log$
  11. * Revision 1.1 2002/09/03 18:43:50 nickm
  12. * Add function to fake a poll call using select
  13. *
  14. */
  15. #ifndef __FAKEPOLL_H
  16. #define __FAKEPOLL_H
  17. #include "orconfig.h"
  18. #undef VERSION
  19. #ifndef HAVE_POLL_H
  20. #ifndef HAVE_SYS_POLL_H
  21. #define USE_FAKE_POLL
  22. struct pollfd {
  23. int fd;
  24. short events;
  25. short revents;
  26. };
  27. #define POLLIN 0x0001
  28. #define POLLPRI 0x0002
  29. #define POLLOUT 0x0004
  30. #define POLLERR 0x0008
  31. #define POLLHUP 0x0010
  32. #define POLLNVAL 0x0020
  33. int poll(struct pollfd *ufds, unsigned int nfds, int timeout);
  34. #endif
  35. #endif
  36. #endif