OSDN Git Service

2010-11-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / libjava / include / solaris-signal.h
1 // sparc-signal.h - Catch runtime signals and turn them into exceptions.
2
3 /* Copyright (C) 1998, 1999, 2000, 2009  Free Software Foundation
4
5    This file is part of libgcj.
6
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
9 details.  */
10
11 #ifndef JAVA_SIGNAL_H
12 #define JAVA_SIGNAL_H 1
13
14 #include <signal.h>
15
16 #define HANDLE_SEGV 1
17 #define HANDLE_FPE 1
18
19 #define SIGNAL_HANDLER(_name)                                           \
20 static void _Jv_##_name (int,                                           \
21                          siginfo_t *_si __attribute__ ((__unused__)),   \
22                          void *_uc __attribute__ ((__unused__)))
23
24 #define MAKE_THROW_FRAME(_exception)
25
26 #define INIT_SEGV                                               \
27 do                                                              \
28   {                                                             \
29     struct sigaction act;                                       \
30     act.sa_sigaction = _Jv_catch_segv;                          \
31     act.sa_flags = SA_SIGINFO | SA_NODEFER;                     \
32     sigemptyset (&act.sa_mask);                                 \
33     sigaction (SIGSEGV, &act, NULL);                            \
34   }                                                             \
35 while (0)                                                       
36                                                                 
37 #define INIT_FPE                                                \
38 do                                                              \
39   {                                                             \
40     struct sigaction act;                                       \
41     act.sa_sigaction = _Jv_catch_fpe;                           \
42     act.sa_flags = SA_SIGINFO | SA_NODEFER;                     \
43     sigemptyset (&act.sa_mask);                                 \
44     sigaction (SIGFPE, &act, NULL);                             \
45   }                                                             \
46 while (0)
47
48 #endif /* JAVA_SIGNAL_H */