networking · beginner · ~15 min

Valid backlog value?

Validate the listen backlog argument.

Challenge

Implement int valid_backlog(int b) returning 1 if b >= 0 (a valid listen backlog), else 0.

Starter code

int valid_backlog(int b) {
    /* TODO */
    return 0;
}

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