networking · beginner · ~15 min
Test a readiness bit across fds.
Implement int any_readable(const int *revents, int n, int pollin) returning 1 if any fd has the POLLIN bit (revents[i] & pollin) set, else 0.
int any_readable(const int *revents, int n, int pollin) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.