linux-sysprog · intermediate · ~15 min

Does the handler get siginfo?

Detect the SA_SIGINFO flag.

Challenge

Implement int gets_siginfo(int flags) returning 1 if SA_SIGINFO is set (so the three-argument handler is used), else 0.

Starter code

#include <signal.h>

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

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