Implement signal-string conversion

This commit is contained in:
Mark 2020-07-26 20:58:48 +03:00
parent 6296f1b51e
commit 4b20c66b69

View File

@ -2,6 +2,31 @@
#include <string.h>
static const char *signal0[NSIG] = {
[SIGHUP] = "Hangup",
[SIGINT] = "Interrupt",
[SIGQUIT] = "Quit",
[SIGILL] = "Illegal instruction",
[SIGTRAP] = "Trace/breakpoint trap",
[SIGABRT] = "Abort",
[SIGBUS] = "Bus error",
[SIGFPE] = "Floating point exception",
[SIGKILL] = "Killed",
[SIGUSR1] = "User signal 1",
[SIGSEGV] = "Segmentation fault",
[SIGUSR2] = "User signal 2",
[SIGPIPE] = "Broken pipe",
[SIGALRM] = "Alarm clock",
[SIGTERM] = "Terminated",
[SIGSYS] = "Invalid system call",
[SIGCHLD] = "Child exited",
[SIGCONT] = "Continued",
[SIGSTOP] = "Stopped",
[SIGTSTP] = "Terminal stop",
[SIGTTIN] = "Stopped (tty input)",
[SIGTTOU] = "Stopped (tty output)",
[SIGURG] = "Urgent I/O condition",
[SIGPWR] = "Power fault",
[SIGWINCH] = "Window size changed"
};
char *strsignal(int signum) {