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)
57 /* Make SIGBUS a synonym for SIGSEGV
58 (segfault leads to any of them depending on the system) */
59 if ((got == SIGBUS) && !strcmp("SIGSEGV", expected))
62 for (i = 0; signals[i].number != -1; i++)
63 if (signals[i].number == got)
64 return (signals[i].name);
66 return bprintf("SIG UNKNOWN (%d)", got);