aix-signal.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* aix-signal.h - Catch runtime signals and turn them into exceptions,
  2. on a AIX system. */
  3. /* Copyright (C) 2008, 2011 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. /* This file is really more of a specification. The rest of the system
  9. should be arranged so that this Just Works. */
  10. #ifndef JAVA_SIGNAL_H
  11. # define JAVA_SIGNAL_H 1
  12. #include <sys/types.h>
  13. #include <sys/signal.h>
  14. typedef void (* SIG_PF)(int);
  15. # define HANDLE_SEGV 1
  16. # undef HANDLE_FPE
  17. # define SIGNAL_HANDLER(_name) \
  18. static void _name (int _dummy __attribute__ ((unused)))
  19. # define MAKE_THROW_FRAME(_exception)
  20. # define INIT_SEGV \
  21. do { \
  22. struct sigaction sa; \
  23. sa.sa_handler = catch_segv; \
  24. sigemptyset (&sa.sa_mask); \
  25. sa.sa_flags = SA_NODEFER; \
  26. sigaction (SIGBUS, &sa, NULL); \
  27. sigaction (SIGSEGV, &sa, NULL); \
  28. } while (0)
  29. # define INIT_FPE \
  30. do { \
  31. struct sigaction sa; \
  32. sa.sa_handler = catch_fpe; \
  33. sigemptyset (&sa.sa_mask); \
  34. sa.sa_flags = SA_NODEFER; \
  35. sigaction (SIGFPE, &sa, NULL); \
  36. } while (0)
  37. #endif /* JAVA_SIGNAL_H */