+ timewarp_wait();
+ pollfds = xmalloc(hmap_count(&loop->poll_nodes) * sizeof *pollfds);
+
+#ifdef _WIN32
+ wevents = xmalloc(hmap_count(&loop->poll_nodes) * sizeof *wevents);
+#endif
+
+ /* Populate with all the fds and events. */
+ i = 0;
+ HMAP_FOR_EACH (node, hmap_node, &loop->poll_nodes) {
+ pollfds[i] = node->pollfd;
+#ifdef _WIN32
+ wevents[i] = node->wevent;
+ if (node->pollfd.fd && node->wevent) {
+ short int wsa_events = 0;
+ if (node->pollfd.events & POLLIN) {
+ wsa_events |= FD_READ | FD_ACCEPT | FD_CLOSE;
+ }
+ if (node->pollfd.events & POLLOUT) {
+ wsa_events |= FD_WRITE | FD_CONNECT | FD_CLOSE;
+ }
+ WSAEventSelect(node->pollfd.fd, node->wevent, wsa_events);
+ }
+#endif
+ i++;
+ }
+
+ retval = time_poll(pollfds, hmap_count(&loop->poll_nodes), wevents,