49
49
FD_SET(fd, &(ev->select_set_write));
51
51
FD_SET(fd, &(ev->select_set_error));
53
53
if (fd > ev->select_max_fd) ev->select_max_fd = fd;
58
58
static int fdevent_select_poll(fdevents *ev, int timeout_ms) {
61
61
tv.tv_sec = timeout_ms / 1000;
62
62
tv.tv_usec = (timeout_ms % 1000) * 1000;
64
64
ev->select_read = ev->select_set_read;
65
65
ev->select_write = ev->select_set_write;
66
66
ev->select_error = ev->select_set_error;
68
68
return select(ev->select_max_fd + 1, &(ev->select_read), &(ev->select_write), &(ev->select_error), &tv);
71
71
static int fdevent_select_event_get_revent(fdevents *ev, size_t ndx) {
74
74
if (FD_ISSET(ndx, &(ev->select_read))) {