poll.h 751 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. typedef unsigned long nfds_t;
  19. struct pollfd
  20. {
  21. int fd;
  22. short events;
  23. short revents;
  24. };
  25. int poll (struct pollfd *, nfds_t, int);
  26. #ifdef _GNU_SOURCE
  27. #define __NEED_time_t
  28. #define __NEED_struct_timespec
  29. #define __NEED_sigset_t
  30. #include <bits/alltypes.h>
  31. int ppoll(struct pollfd *, nfds_t, const struct timespec *, const sigset_t *);
  32. #endif
  33. #ifdef __cplusplus
  34. }
  35. #endif
  36. #endif