poll.h 641 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <signal.h>
  8. #include <sys/cdefs.h>
  9. __BEGIN_DECLS
  10. #define POLLIN (1u << 0)
  11. #define POLLPRI (1u << 1)
  12. #define POLLOUT (1u << 2)
  13. #define POLLERR (1u << 3)
  14. #define POLLHUP (1u << 4)
  15. #define POLLNVAL (1u << 5)
  16. #define POLLRDHUP (1u << 13)
  17. struct pollfd {
  18. int fd;
  19. short events;
  20. short revents;
  21. };
  22. typedef unsigned nfds_t;
  23. int poll(struct pollfd* fds, nfds_t nfds, int timeout);
  24. int ppoll(struct pollfd* fds, nfds_t nfds, const struct timespec* timeout, const sigset_t* sigmask);
  25. __END_DECLS