dfs_poll.h 983 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (c) 2006-2018, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. */
  9. #ifndef DFS_POLL_H__
  10. #define DFS_POLL_H__
  11. #include <rtthread.h>
  12. #ifdef RT_USING_POSIX
  13. #include <sys/time.h> /* for struct timeval */
  14. #if !defined(POLLIN) && !defined(POLLOUT)
  15. #define POLLIN (0x01)
  16. #define POLLRDNORM (0x01)
  17. #define POLLRDBAND (0x01)
  18. #define POLLPRI (0x01)
  19. #define POLLOUT (0x02)
  20. #define POLLWRNORM (0x02)
  21. #define POLLWRBAND (0x02)
  22. #define POLLERR (0x04)
  23. #define POLLHUP (0x08)
  24. #define POLLNVAL (0x10)
  25. typedef unsigned int nfds_t;
  26. struct pollfd
  27. {
  28. int fd;
  29. short events;
  30. short revents;
  31. };
  32. #endif /* !defined(POLLIN) && !defined(POLLOUT) */
  33. #define POLLMASK_DEFAULT (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)
  34. int poll(struct pollfd *fds, nfds_t nfds, int timeout);
  35. #endif /* RT_USING_POSIX */
  36. #endif /* DFS_POLL_H__ */