linux-sysprog · beginner · ~15 min

Coalesced signals

Understand that standard signals can be coalesced.

Challenge

Standard signals don't queue — multiple deliveries while one is pending collapse into one. Implement int signals_lost(int sent, int delivered) returning how many were lost (sent - delivered, never negative).

Starter code

int signals_lost(int sent, int delivered) {
    /* TODO */
    return 0;
}

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