From e611b132f9b8abe35b362e5870b74bce94a1e58e Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 16 May 2020 20:51:50 -0700 Subject: initial commit --- private/inc/sys/poll.h | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 private/inc/sys/poll.h (limited to 'private/inc/sys/poll.h') diff --git a/private/inc/sys/poll.h b/private/inc/sys/poll.h new file mode 100644 index 000000000..e2599db6c --- /dev/null +++ b/private/inc/sys/poll.h @@ -0,0 +1,75 @@ +/*++ + +Copyright (c) 1991 Microsoft Corporation + +Module Name: + + poll.h + +Abstract: + + Contains #defines, types, and macros for poll + +Author: + + Sam Patton (sampa) July 26, 1991 + +Revision History: + +--*/ + +#ifndef SYS_POLL_INCLUDED +#define SYS_POLL_INCLUDED + +/* + * Structure of file descriptor/event pairs supplied in + * the poll arrays. + */ +struct pollfd { +#ifndef _POSIX_SOURCE + HANDLE fd; /* file handle to poll */ +#else + int fd; /* file desc to poll */ +#endif + short events; /* events of interest on fd */ + short revents; /* events that occurred on fd */ +}; + +/* + * Testable select events + */ +#define POLLIN 01 /* fd is readable */ +#define POLLPRI 02 /* priority info at fd */ +#define POLLOUT 04 /* fd is writeable (won't block) */ +#define POLLMSG 0100 /* M_SIG or M_PCSIG arrived */ + +/* + * Non-testable poll events (may not be specified in events field, + * but may be returned in revents field). + */ +#define POLLERR 010 /* fd has error condition */ +#define POLLHUP 020 /* fd has been hung up on */ +#define POLLNVAL 040 /* invalid pollfd entry */ + +/* + * Number of pollfd entries to read in at a time in poll. + * The larger the value the better the performance, up to the + * maximum number of open files allowed. Large numbers will + * use excessive amounts of kernel stack space. + */ +#define NPOLLFILE 20 + + +/* + * Poll function prototype + * + */ + +int +poll( + IN OUT struct pollfd *, + IN unsigned int, + IN int); + + +#endif //SYS_POLL_INCLUDED -- cgit v1.2.3