poll.h 970 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2021-09-11 Meco Man First version
  9. */
  10. #ifndef __POLL_H__
  11. #define __POLL_H__
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #if !defined(POLLIN) && !defined(POLLOUT)
  16. #define POLLIN (0x01)
  17. #define POLLRDNORM (0x01)
  18. #define POLLRDBAND (0x01)
  19. #define POLLPRI (0x01)
  20. #define POLLOUT (0x02)
  21. #define POLLWRNORM (0x02)
  22. #define POLLWRBAND (0x02)
  23. #define POLLERR (0x04)
  24. #define POLLHUP (0x08)
  25. #define POLLNVAL (0x10)
  26. typedef unsigned int nfds_t;
  27. struct pollfd
  28. {
  29. int fd;
  30. short events;
  31. short revents;
  32. };
  33. #endif /* !defined(POLLIN) && !defined(POLLOUT) */
  34. #define POLLMASK_DEFAULT (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)
  35. int poll(struct pollfd *fds, nfds_t nfds, int timeout);
  36. #ifdef __cplusplus
  37. }
  38. #endif
  39. #endif /* __POLL_H__ */