poll.h 850 B

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