linux-sysprog · beginner · ~15 min
Model the two-strike shutdown policy.
Many programs exit only after a second Ctrl-C. Implement int should_force_exit(int sigint_count) returning 1 if sigint_count is 2 or more, else 0.
int should_force_exit(int sigint_count) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.