1 /* signal -- what TESH needs to know about signals */
3 /* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
4 * All rights reserved. */
6 /* This program is free software; you can redistribute it and/or modify it
7 * under the terms of the license (GNU LGPL) which comes with this package. */
12 typedef struct s_signal_entry {
15 } s_signal_entry_t, *signal_entry_t;
17 static const s_signal_entry_t signals[] = {
42 {"SIGVTALRM", SIGVTALRM},
44 {"SIGWINCH", SIGWINCH},
51 const char *signal_name(unsigned int got, char *expected)
55 /* Make SIGBUS a synonym for SIGSEGV
56 (segfault leads to any of them depending on the system) */
57 if ((got == SIGBUS) && !strcmp("SIGSEGV", expected))
60 for (i = 0; signals[i].number != -1; i++)
61 if (signals[i].number == got)
62 return (signals[i].name);
64 return bprintf("SIG UNKNOWN (%d)", got);