poll.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef __GBLIBC_POLL_H_
  2. #define __GBLIBC_POLL_H_
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. typedef unsigned int nfds_t;
  7. #define POLLIN 0x0001 /* any readable data available */
  8. #define POLLPRI 0x0002 /* OOB/Urgent readable data */
  9. #define POLLOUT 0x0004 /* file descriptor is writeable */
  10. #define POLLRDNORM 0x0040 /* non-OOB/URG data available */
  11. #define POLLWRNORM POLLOUT /* no write type differentiation */
  12. #define POLLRDBAND 0x0080 /* OOB/Urgent readable data */
  13. #define POLLWRBAND 0x0100 /* OOB/Urgent data can be written */
  14. #define POLLERR 0x0008 /* some poll error occurred */
  15. #define POLLHUP 0x0010 /* file descriptor was "hung up" */
  16. #define POLLNVAL 0x0020 /* requested events "invalid" */
  17. #define POLLSTANDARD (POLLIN|POLLPRI|POLLOUT|POLLRDNORM|POLLRDBAND|\
  18. POLLWRBAND|POLLERR|POLLHUP|POLLNVAL)
  19. struct pollfd {
  20. int fd;
  21. short events;
  22. short revents;
  23. };
  24. #ifdef __cplusplus
  25. }
  26. #endif
  27. #endif