3 /* signal -- what TESH needs to know about signals */
5 /* Copyright (c) 2007 Martin Quinson. */
6 /* All rights reserved. */
8 /* This program is free software; you can redistribute it and/or modify it
9 * under the terms of the license (GNU LGPL) which comes with this package. */
14 typedef struct s_signal_entry {
17 } s_signal_entry_t,* signal_entry_t;
19 static const s_signal_entry_t signals[] = {
44 {"SIGVTALRM" ,SIGVTALRM},
46 {"SIGWINCH" ,SIGWINCH},
53 const char* signal_name(unsigned int got, char *expected) {
56 /* Make SIGBUS a synonym for SIGSEGV
57 (segfault leads to any of them depending on the system) */
58 if((got == SIGBUS) && !strcmp("SIGSEGV",expected))
61 for (i=0; signals[i].number != -1; i++)
62 if (signals[i].number == got)
63 return (signals[i].name);
65 return bprintf("SIG UNKNOWN (%d)", got);