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