poll.h 765 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef __POLL_H__
  2. #define __POLL_H__
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #if !defined(POLLIN) && !defined(POLLOUT)
  7. #define POLLIN (0x01)
  8. #define POLLRDNORM (0x01)
  9. #define POLLRDBAND (0x01)
  10. #define POLLPRI (0x01)
  11. #define POLLOUT (0x02)
  12. #define POLLWRNORM (0x02)
  13. #define POLLWRBAND (0x02)
  14. #define POLLERR (0x04)
  15. #define POLLHUP (0x08)
  16. #define POLLNVAL (0x10)
  17. typedef unsigned int nfds_t;
  18. struct pollfd
  19. {
  20. int fd;
  21. short events;
  22. short revents;
  23. };
  24. #endif /* !defined(POLLIN) && !defined(POLLOUT) */
  25. #define POLLMASK_DEFAULT (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)
  26. int poll(struct pollfd *fds, nfds_t nfds, int timeout);
  27. #ifdef __cplusplus
  28. }
  29. #endif
  30. #endif /* __POLL_H__ */