poll.h 777 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef _POLL_H
  2. #define _POLL_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <features.h>
  7. #define POLLIN 0x001
  8. #define POLLPRI 0x002
  9. #define POLLOUT 0x004
  10. #define POLLERR 0x008
  11. #define POLLHUP 0x010
  12. #define POLLNVAL 0x020
  13. #define POLLRDNORM 0x040
  14. #define POLLRDBAND 0x080
  15. #define POLLWRNORM 0x100
  16. #define POLLWRBAND 0x200
  17. #define POLLMSG 0x400
  18. #define POLLRDHUP 0x2000
  19. typedef unsigned long nfds_t;
  20. struct pollfd
  21. {
  22. int fd;
  23. short events;
  24. short revents;
  25. };
  26. int poll (struct pollfd *, nfds_t, int);
  27. #ifdef _GNU_SOURCE
  28. #define __NEED_time_t
  29. #define __NEED_struct_timespec
  30. #define __NEED_sigset_t
  31. #include <bits/alltypes.h>
  32. int ppoll(struct pollfd *, nfds_t, const struct timespec *, const sigset_t *);
  33. #endif
  34. #ifdef __cplusplus
  35. }
  36. #endif
  37. #endif