dfs_poll.h 691 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef DFS_POLL_H__
  2. #define DFS_POLL_H__
  3. #include <rtthread.h>
  4. #ifdef RT_USING_POSIX
  5. #include <sys/time.h> /* for struct timeval */
  6. #define POLLIN (0x01)
  7. #define POLLRDNORM (0x01)
  8. #define POLLRDBAND (0x01)
  9. #define POLLPRI (0x01)
  10. #define POLLOUT (0x02)
  11. #define POLLWRNORM (0x02)
  12. #define POLLWRBAND (0x02)
  13. #define POLLERR (0x04)
  14. #define POLLHUP (0x08)
  15. #define POLLNVAL (0x10)
  16. #define POLLMASK_DEFAULT (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)
  17. typedef unsigned int nfds_t;
  18. struct pollfd
  19. {
  20. int fd;
  21. short events;
  22. short revents;
  23. };
  24. int poll(struct pollfd *fds, nfds_t nfds, int timeout);
  25. #endif
  26. #endif