4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 1999 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #pragma ident "%Z%%M% %I% %E% SMI"
36 #include <sys/termio.h>
38 #include <fcode/private.h>
39 #include <fcode/log.h>
41 static fcode_env_t
*saved_envp
;
42 static struct termio saved_termio
;
45 process_signal(int sig
, siginfo_t
*sip
, void *addr
)
48 * Format appropriate error message, want fault addr if Bus Error
49 * or Segmentation Violation.
56 forth_abort(saved_envp
, "%s: Fault Addr: 0x%08x",
57 strsignal(sig
), sip
->si_addr
);
60 ioctl(fileno(stdin
), TCSETA
, &saved_termio
);
61 log_message(MSG_FATAL
, "SIGQUIT\n");
65 ioctl(fileno(stdin
), TCSETA
, &saved_termio
);
68 forth_abort(saved_envp
, strsignal(sig
));
72 install_handlers(fcode_env_t
*env
)
78 ioctl(fileno(stdin
), TCGETA
, &saved_termio
);
80 sigemptyset(&sa
.sa_mask
);
81 sa
.sa_flags
= SA_SIGINFO
|SA_NODEFER
;
83 sa
.sa_sigaction
= process_signal
;
85 sigaction(SIGINT
, &sa
, NULL
);
86 sigaction(SIGQUIT
, &sa
, NULL
);
87 sigaction(SIGSEGV
, &sa
, NULL
);
88 sigaction(SIGBUS
, &sa
, NULL
);
89 sigaction(SIGUSR1
, &sa
, NULL
);
90 sigaction(SIGFPE
, &sa
, NULL
);