linux-sysprog · intermediate · ~15 min

Does the handler auto-restart syscalls?

Test a flag bit in the sigaction flags word.

Challenge

sigaction flags control behaviour. Implement int restarts_syscalls(int flags) returning 1 if the SA_RESTART bit is set, else 0.

Starter code

#include <signal.h>

int restarts_syscalls(int flags) {
    /* TODO */
    return 0;
}

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