Displaying 1 result from an estimated 1 matches for "fd_to_pollfd".
2013 Jan 03
20
[PATCH] Switch to poll in xenconsoled's io loop.
...FD_SET(xs_fileno(xs), &readfds);
- max_fd = MAX(xs_fileno(xs), max_fd);
-
- if (log_hv) {
- FD_SET(xc_evtchn_fd(xce_handle), &readfds);
- max_fd = MAX(xc_evtchn_fd(xce_handle), max_fd);
- }
+#define MAX_POLL_FDS 8192
+ static struct pollfd fds[MAX_POLL_FDS];
+ static struct pollfd *fd_to_pollfd[MAX_POLL_FDS];
+ int nr_fds;
+#define SET_FDS(_fd, _events) do { \
+ if (_fd >= MAX_POLL_FDS) \
+ break; \
+ fds[nr_fds].fd = (_fd); \
+ fds[nr_fds].events = (_events); \
+ fd_to_pollfd[(_fd)] = &fds[nr_fds]; \
+ nr_fds++; \
+ } while (0)
+#define FD_REVENTS(_fd)...