dfs_poll.h 851 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #define POLLIN (0x01)
  15. #define POLLRDNORM (0x01)
  16. #define POLLRDBAND (0x01)
  17. #define POLLPRI (0x01)
  18. #define POLLOUT (0x02)
  19. #define POLLWRNORM (0x02)
  20. #define POLLWRBAND (0x02)
  21. #define POLLERR (0x04)
  22. #define POLLHUP (0x08)
  23. #define POLLNVAL (0x10)
  24. #define POLLMASK_DEFAULT (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)
  25. typedef unsigned int nfds_t;
  26. struct pollfd
  27. {
  28. int fd;
  29. short events;
  30. short revents;
  31. };
  32. int poll(struct pollfd *fds, nfds_t nfds, int timeout);
  33. #endif
  34. #endif