5
* Andreas Boose <viceteam@t-online.de>
7
* This file is part of VICE, the Versatile Commodore Emulator.
8
* See README for copyright notice.
10
* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
38
static RETSIGTYPE break64(int sig)
41
#ifdef SYS_SIGLIST_DECLARED
42
log_message(LOG_DEFAULT, "Received signal %d (%s).",
43
sig, sys_siglist[sig]);
45
log_message(LOG_DEFAULT, "Received signal %d.", sig);
51
void signals_init(int do_core_dumps)
53
signal(SIGINT, SIG_IGN);
56
signal(SIGSEGV, break64);
57
signal(SIGILL, break64);
58
signal(SIGPIPE, break64);
59
signal(SIGHUP, break64);
60
signal(SIGQUIT, break64);
64
typedef void (*signal_handler_t)(int);
66
static signal_handler_t old_handler;
68
static void handle_abort(int signo)
71
signal(SIGINT, (signal_handler_t)handle_abort);
74
void signals_abort_set(void)
76
old_handler = signal(SIGINT, handle_abort);
79
void signals_abort_unset(void)
81
signal(SIGINT, old_handler);