networking · beginner · ~15 min

Cap the maxevents argument

Bound the epoll_wait maxevents.

Challenge

Implement int cap_maxevents(int requested, int cap) returning requested capped at cap, at least 1.

Starter code

int cap_maxevents(int requested, int cap) {
    /* TODO */
    return 1;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.