hppa-signal.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* hppa-signal.h - Catch runtime signals and turn them into exceptions,
  2. on a HP-UX 11 PA system. */
  3. /* Copyright (C) 2006, 2009 Free Software Foundation
  4. This file is part of libgcj.
  5. This software is copyrighted work licensed under the terms of the
  6. Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
  7. details. */
  8. #ifndef JAVA_SIGNAL_H
  9. #define JAVA_SIGNAL_H 1
  10. #include <signal.h>
  11. #define HANDLE_SEGV 1
  12. #define HANDLE_FPE 1
  13. #define SIGNAL_HANDLER(_name) \
  14. static void _name (int _dummy __attribute__ ((unused)), \
  15. siginfo_t *_info __attribute__ ((__unused__)), \
  16. void *arg __attribute__ ((__unused__)))
  17. #define MAKE_THROW_FRAME(_exception)
  18. #define INIT_SEGV \
  19. do \
  20. { \
  21. struct sigaction sa; \
  22. sa.sa_sigaction = catch_segv; \
  23. sigemptyset (&sa.sa_mask); \
  24. sa.sa_flags = SA_SIGINFO | SA_NODEFER; \
  25. sigaction (SIGSEGV, &sa, NULL); \
  26. } \
  27. while (0)
  28. #define INIT_FPE \
  29. do \
  30. { \
  31. struct sigaction sa; \
  32. sa.sa_sigaction = catch_fpe; \
  33. sigemptyset (&sa.sa_mask); \
  34. sa.sa_flags = SA_SIGINFO | SA_NODEFER; \
  35. sigaction (SIGFPE, &sa, NULL); \
  36. } \
  37. while (0)
  38. #endif /* JAVA_SIGNAL_H */