From 062dc3418180839b5f615eea8a89e40b1cd5abbf Mon Sep 17 00:00:00 2001 From: Daniel Reinhold Date: Sun, 17 Nov 2002 04:49:14 +0000 Subject: [PATCH] the signal string table was fixed to contain proper output strings -- the old debug table is still there, now renamed 'sigstr[]' MAX_SIGNO replaces 32 in several spots git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1976 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/signal.c | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/src/kernel/core/signal.c b/src/kernel/core/signal.c index 97bf7c8956..8d582ecdae 100644 --- a/src/kernel/core/signal.c +++ b/src/kernel/core/signal.c @@ -17,7 +17,35 @@ #include -const char * const sys_siglist[NSIG] = { +const char * const +sys_siglist[NSIG] = { + /* 0 */ "Signal 0", + /* 1 - SIGHUP */ "Hangup", + /* 2 - SIGINT */ "Interrupt", + /* 3 - SIGQUIT */ "Quit", + /* 4 - SIGILL */ "Illegal instruction", + /* 5 - SIGCHLD */ "Child exited", + /* 6 - SIGABRT */ "Abort", + /* 7 - SIGPIPE */ "Broken pipe", + /* 8 - SIGFPE */ "Floating point exception", + /* 9 - SIGKILL */ "Killed (by death)", + /* 10 - SIGSTOP */ "Stopped", + /* 11 - SIGSEGV */ "Segmentation violation", + /* 12 - SIGCONT */ "Continued", + /* 13 - SIGTSTP */ "Stopped (tty output)", + /* 14 - SIGALRM */ "Alarm", + /* 15 - SIGTERM */ "Termination requested", + /* 16 - SIGTTIN */ "Stopped (tty input)", + /* 17 - SIGTTOU */ "Stopped (tty output)", + /* 18 - SIGUSR1 */ "User defined signal 1", + /* 19 - SIGUSR2 */ "User defined signal 2", + /* 20 - SIGWINCH */ "Window size changed", + /* 21 - SIGKILLTHR */ "Kill Thread", + /* 22 - SIGTRAP */ NULL +}; + + +const char * const sigstr[NSIG] = { "NONE", "HUP", "INT", "QUIT", "ILL", "CHLD", "ABRT", "PIPE", "FPE", "KILL", "STOP", "SEGV", "CONT", "TSTP", "ALRM", "TERM", "TTIN", "TTOU", "USR1", "USR2", "WINCH", "KILLTHR", "TRAP" @@ -41,7 +69,7 @@ handle_signals(struct thread *t, int state) sig_mask >>= 1; t->sig_pending &= ~(1L << i); - dprintf("Thread 0x%lx received signal %s\n", t->id, sys_siglist[sig]); + dprintf("Thread 0x%lx received signal %s\n", t->id, sigstr[sig]); if (handler->sa_handler == SIG_IGN) { // signal is to be ignored @@ -107,7 +135,7 @@ send_signal_etc(pid_t tid, uint sig, uint32 flags) int state; struct thread *t, *main_t; - if ((sig < 1) || (sig > 32)) + if ((sig < 1) || (sig > MAX_SIGNO)) return B_BAD_VALUE; state = disable_interrupts(); @@ -218,7 +246,7 @@ sys_sigaction(int sig, const struct sigaction *act, struct sigaction *oact) struct thread *t; int state; - if ((sig < 1) || (sig > 32)) + if ((sig < 1) || (sig > MAX_SIGNO)) return EINVAL; if ((sig == SIGKILL) || (sig == SIGKILLTHR) || (sig == SIGSTOP)) return EINVAL;