2
0

poll.h 994 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. int fd;
  27. short events;
  28. short revents;
  29. };
  30. int poll (struct pollfd *, nfds_t, int);
  31. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  32. #define __NEED_time_t
  33. #define __NEED_struct_timespec
  34. #define __NEED_sigset_t
  35. #include <bits/alltypes.h>
  36. int ppoll(struct pollfd *, nfds_t, const struct timespec *, const sigset_t *);
  37. #endif
  38. #if _REDIR_TIME64
  39. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  40. __REDIR(ppoll, __ppoll_time64);
  41. #endif
  42. #endif
  43. #ifdef __cplusplus
  44. }
  45. #endif
  46. #endif