diff --git a/headers/posix/signal.h b/headers/posix/signal.h index d332f3a136..bf9d794ff7 100644 --- a/headers/posix/signal.h +++ b/headers/posix/signal.h @@ -87,39 +87,46 @@ typedef struct stack_t { * some consistency with UN*X conventions so that things * like "kill -9" do what you expect. */ -#define SIGHUP 1 /* hangup -- tty is gone! */ -#define SIGINT 2 /* interrupt */ -#define SIGQUIT 3 /* `quit' special character typed in tty */ -#define SIGILL 4 /* illegal instruction */ -#define SIGCHLD 5 /* child process exited */ -#define SIGABRT 6 /* abort() called, dont' catch */ -#define SIGPIPE 7 /* write to a pipe w/no readers */ -#define SIGFPE 8 /* floating point exception */ -#define SIGKILL 9 /* kill a team (not catchable) */ -#define SIGSTOP 10 /* suspend a thread (not catchable) */ -#define SIGSEGV 11 /* segmentation violation (read: invalid pointer) */ -#define SIGCONT 12 /* continue execution if suspended */ -#define SIGTSTP 13 /* `stop' special character typed in tty */ -#define SIGALRM 14 /* an alarm has gone off (see alarm()) */ -#define SIGTERM 15 /* termination requested */ -#define SIGTTIN 16 /* read of tty from bg process */ -#define SIGTTOU 17 /* write to tty from bg process */ -#define SIGUSR1 18 /* app defined signal 1 */ -#define SIGUSR2 19 /* app defined signal 2 */ -#define SIGWINCH 20 /* tty window size changed */ -#define SIGKILLTHR 21 /* be specific: kill just the thread, not team */ -#define SIGTRAP 22 +#define SIGHUP 1 /* hangup -- tty is gone! */ +#define SIGINT 2 /* interrupt */ +#define SIGQUIT 3 /* `quit' special character typed in tty */ +#define SIGILL 4 /* illegal instruction */ +#define SIGCHLD 5 /* child process exited */ +#define SIGABRT 6 /* abort() called, dont' catch */ +#define SIGPIPE 7 /* write to a pipe w/no readers */ +#define SIGFPE 8 /* floating point exception */ +#define SIGKILL 9 /* kill a team (not catchable) */ +#define SIGSTOP 10 /* suspend a thread (not catchable) */ +#define SIGSEGV 11 /* segmentation violation (read: invalid pointer) */ +#define SIGCONT 12 /* continue execution if suspended */ +#define SIGTSTP 13 /* `stop' special character typed in tty */ +#define SIGALRM 14 /* an alarm has gone off (see alarm()) */ +#define SIGTERM 15 /* termination requested */ +#define SIGTTIN 16 /* read of tty from bg process */ +#define SIGTTOU 17 /* write to tty from bg process */ +#define SIGUSR1 18 /* app defined signal 1 */ +#define SIGUSR2 19 /* app defined signal 2 */ +#define SIGWINCH 20 /* tty window size changed */ +#define SIGKILLTHR 21 /* be specific: kill just the thread, not team */ +#define SIGTRAP 22 /* Trace/breakpoint trap */ +#define SIGPOLL 23 /* Pollable event */ +#define SIGPROF 24 /* Profiling timer expired */ +#define SIGSYS 25 /* Bad system call */ +#define SIGURG 26 /* High bandwidth data is available at socket */ +#define SIGVTALRM 27 /* Virtual timer expired */ +#define SIGXCPU 28 /* CPU time limit exceeded */ +#define SIGXFSZ 29 /* File size limit exceeded */ #define SIGBUS SIGSEGV /* for old style code */ /* - * Signal numbers 23-32 are currently free but may be used in future + * Signal numbers 30-32 are currently free but may be used in future * releases. Use them at your own peril (if you do use them, at least * be smart and use them backwards from signal 32). */ #define MAX_SIGNO 32 /* the most signals that a single thread can reference */ -#define __signal_max 22 /* the largest signal number that is actually defined */ +#define __signal_max 29 /* the largest signal number that is actually defined */ #define NSIG (__signal_max+1) /* the number of defined signals */ diff --git a/src/system/kernel/signal.c b/src/system/kernel/signal.c index e9cd2a9ce1..5f0e4c7b27 100644 --- a/src/system/kernel/signal.c +++ b/src/system/kernel/signal.c @@ -39,7 +39,8 @@ 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" + "TTIN", "TTOU", "USR1", "USR2", "WINCH", "KILLTHR", "TRAP", + "POLL", "PROF", "SYS", "URG", "VTALRM", "XCPU", "XFSZ" }; @@ -127,6 +128,7 @@ handle_signals(struct thread *thread) case SIGTTIN: case SIGTTOU: case SIGCONT: + case SIGURG: // notify the debugger if (debugSignal) notify_debugger(thread, signal, handler, false); @@ -148,6 +150,12 @@ handle_signals(struct thread *thread) case SIGABRT: case SIGFPE: case SIGSEGV: + case SIGPOLL: + case SIGPROF: + case SIGSYS: + case SIGVTALRM: + case SIGXCPU: + case SIGXFSZ: TRACE(("Shutting down thread 0x%lx due to signal #%d\n", thread->id, signal)); case SIGKILL: diff --git a/src/system/libroot/posix/signal/strsignal.c b/src/system/libroot/posix/signal/strsignal.c index 8f65c08c5c..1fa3ae0f72 100644 --- a/src/system/libroot/posix/signal/strsignal.c +++ b/src/system/libroot/posix/signal/strsignal.c @@ -41,7 +41,15 @@ sys_siglist[NSIG] = { /* 19 - SIGUSR2 */ "User defined signal 2", /* 20 - SIGWINCH */ "Window size changed", /* 21 - SIGKILLTHR */ "Kill Thread", - /* 22 - SIGTRAP */ NULL + /* 22 - SIGTRAP */ "Trace/breakpoint trap", + /* 23 - SIGPOLL */ "Pollable event", + /* 24 - SIGPROF */ "Profiling timer expired", + /* 25 - SIGSYS */ "Bad system call", + /* 26 - SIGURG */ "High bandwidth data is available at socket", + /* 27 - SIGVTALRM */ "Virtual timer expired", + /* 28 - SIGXCPU */ "CPU time limit exceeded", + /* 29 - SIGXFSZ */ "File size limit exceeded", + NULL };