Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. poll.h
  5. Abstract:
  6. Contains #defines, types, and macros for poll
  7. Author:
  8. Sam Patton (sampa) July 26, 1991
  9. Revision History:
  10. --*/
  11. #ifndef SYS_POLL_INCLUDED
  12. #define SYS_POLL_INCLUDED
  13. /*
  14. * Structure of file descriptor/event pairs supplied in
  15. * the poll arrays.
  16. */
  17. struct pollfd {
  18. #ifndef _POSIX_SOURCE
  19. HANDLE fd; /* file handle to poll */
  20. #else
  21. int fd; /* file desc to poll */
  22. #endif
  23. short events; /* events of interest on fd */
  24. short revents; /* events that occurred on fd */
  25. };
  26. /*
  27. * Testable select events
  28. */
  29. #define POLLIN 01 /* fd is readable */
  30. #define POLLPRI 02 /* priority info at fd */
  31. #define POLLOUT 04 /* fd is writeable (won't block) */
  32. #define POLLMSG 0100 /* M_SIG or M_PCSIG arrived */
  33. /*
  34. * Non-testable poll events (may not be specified in events field,
  35. * but may be returned in revents field).
  36. */
  37. #define POLLERR 010 /* fd has error condition */
  38. #define POLLHUP 020 /* fd has been hung up on */
  39. #define POLLNVAL 040 /* invalid pollfd entry */
  40. /*
  41. * Number of pollfd entries to read in at a time in poll.
  42. * The larger the value the better the performance, up to the
  43. * maximum number of open files allowed. Large numbers will
  44. * use excessive amounts of kernel stack space.
  45. */
  46. #define NPOLLFILE 20
  47. /*
  48. * Poll function prototype
  49. *
  50. */
  51. int
  52. poll(
  53. IN OUT struct pollfd *,
  54. IN unsigned int,
  55. IN int);
  56. #endif //SYS_POLL_INCLUDED