ev.h
static int ev_api_watch_fd(ev_context *ctx, int fd) {
    struct poll_api *p_api = ctx->api;
    p_api->fds[p_api->nfds].fd = fd;
    p_api->fds[p_api->nfds].events = POLLIN;
    p_api->nfds++;
    if (p_api->nfds >= p_api->events_monitored) {
        p_api->events_monitored *= 2;
        p_api->fds = realloc(p_api->fds,
                                 p_api->events_monitored * sizeof(struct pollfd));
    }
    return EV_OK;
}
/*
 * Poll maintain in his state the number of file descriptor it monitor in a
 * fixed size array just like the events we monitor over the primitive. If a
 * resize is needed cause the number of fds have reached the length of the fds
 * array, we must increase its size.
 */
Poll maintain in his state the number of file descriptor it monitor in a
fixed size array just like the events we monitor over the primitive. If a
resize is needed cause the number of fds have reached the length of the fds
array, we must increase its size.
Poll maintain in his state the number of file descriptor it monitor in a fixed size array just like the events we monitor over the primitive . If a resize is needed cause the number of fds have reached the length of the fds array we must increase its size .
static int ev_api_watch_fd(ev_context *ctx, int fd) {
    struct poll_api *p_api = ctx->api;
    p_api->fds[p_api->nfds].fd = fd;
    p_api->fds[p_api->nfds].events = POLLIN;
    p_api->nfds++;
    if (p_api->nfds >= p_api->events_monitored) {
        p_api->events_monitored *= 2;
        p_api->fds = realloc(p_api->fds,
                                 p_api->events_monitored * sizeof(struct pollfd));
    }
    return EV_OK;
}
static int ev_api_watch_fd ( ev_context * ctx , int fd ) { struct poll_api * p_api = ctx -> api ; p_api -> fds [ p_api -> nfds ] . fd = fd ; p_api -> fds [ p_api -> nfds ] . events = POLLIN ; p_api -> nfds ++ ; if ( p_api -> nfds >= p_api -> events_monitored ) { p_api -> events_monitored *= 2 ; p_api -> fds = realloc ( p_api -> fds , p_api -> events_monitored * sizeof ( struct pollfd ) ) ; } return EV_OK ; }
Poll maintain in his state the number of file descriptor it monitor in a
 fixed size array just like the events we monitor over the primitive.
Poll maintain in his state the number of file descriptor it monitor in a fixed size array just like the events we monitor over the primitive .