linux-sysprog · beginner · ~15 min
Translate a signal number back to a name.
Implement const char *sig_name(int sig) returning "SIGINT", "SIGTERM", or "SIGKILL" for those signals, else "UNKNOWN".
#include <signal.h>
const char *sig_name(int sig) {
/* TODO */
return "UNKNOWN";
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.