OSDN Git Service

* include/sparc-signal.h: Renamed to ...
[pf3gnuchains/gcc-fork.git] / libjava / include / aix-signal.h
1 /* aix-signal.h - Catch runtime signals and turn them into exceptions,
2    on a Darwin system.  */
3
4 /* Copyright (C) 2008  Free Software Foundation
5
6    This file is part of libgcj.
7
8 This software is copyrighted work licensed under the terms of the
9 Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
10 details.  */
11
12 /* This file is really more of a specification.  The rest of the system
13    should be arranged so that this Just Works.  */
14
15 #ifndef JAVA_SIGNAL_H
16 # define JAVA_SIGNAL_H 1
17
18 #include <sys/types.h>
19 #include <sys/signal.h>
20
21 typedef void (* SIG_PF)(int);
22
23 # define HANDLE_SEGV 1
24 # undef HANDLE_FPE
25
26 # define SIGNAL_HANDLER(_name)                                  \
27   static void _name (int _dummy __attribute__ ((unused)))
28
29 # define MAKE_THROW_FRAME(_exception)
30
31 # define INIT_SEGV                              \
32   do {                                          \
33       struct sigaction sa;                      \
34       sa.sa_handler = catch_segv;               \
35       sigemptyset (&sa.sa_mask);                \
36       sa.sa_flags = SA_NODEFER;                 \
37       sigaction (SIGBUS, &sa, NULL);            \
38       sigaction (SIGSEGV, &sa, NULL);           \
39     } while (0)
40
41 # define INIT_FPE                               \
42   do {                                          \
43       struct sigaction sa;                      \
44       sa.sa_handler = catch_fpe;                \
45       sigemptyset (&sa.sa_mask);                \
46       sa.sa_flags = SA_NODEFER;                 \
47       sigaction (SIGFPE, &sa, NULL);            \
48     } while (0)
49
50 #endif /* JAVA_SIGNAL_H */