signal.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef _INC_SIGNAL
  7. #define _INC_SIGNAL
  8. #include <crtdefs.h>
  9. #include <pthread_signal.h>
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. #ifndef _SIG_ATOMIC_T_DEFINED
  14. #define _SIG_ATOMIC_T_DEFINED
  15. typedef int sig_atomic_t;
  16. #endif
  17. #define NSIG 23
  18. #define SIGINT 2
  19. #define SIGILL 4
  20. #define SIGABRT_COMPAT 6
  21. #define SIGFPE 8
  22. #define SIGSEGV 11
  23. #define SIGTERM 15
  24. #define SIGBREAK 21
  25. #define SIGABRT 22 /* used by abort, replace SIGIOT in the future */
  26. #define SIGABRT2 22
  27. #ifdef _POSIX
  28. #define SIGHUP 1 /* hangup */
  29. #define SIGQUIT 3 /* quit */
  30. #define SIGTRAP 5 /* trace trap (not reset when caught) */
  31. #define SIGIOT 6 /* IOT instruction */
  32. #define SIGEMT 7 /* EMT instruction */
  33. #define SIGKILL 9 /* kill (cannot be caught or ignored) */
  34. #define SIGBUS 10 /* bus error */
  35. #define SIGSYS 12 /* bad argument to system call */
  36. #define SIGPIPE 13 /* write on a pipe with no one to read it */
  37. #ifdef __USE_MINGW_ALARM
  38. #define SIGALRM 14 /* alarm clock */
  39. #endif
  40. #endif
  41. typedef void (*__p_sig_fn_t)(int);
  42. #define SIG_DFL (__p_sig_fn_t)0
  43. #define SIG_IGN (__p_sig_fn_t)1
  44. #define SIG_GET (__p_sig_fn_t)2
  45. #define SIG_SGE (__p_sig_fn_t)3
  46. #define SIG_ACK (__p_sig_fn_t)4
  47. #define SIG_ERR (__p_sig_fn_t)-1
  48. extern void **__cdecl __pxcptinfoptrs(void);
  49. #define _pxcptinfoptrs (*__pxcptinfoptrs())
  50. __p_sig_fn_t __cdecl signal(int _SigNum,__p_sig_fn_t _Func);
  51. int __cdecl raise(int _SigNum);
  52. #ifdef __cplusplus
  53. }
  54. #endif
  55. #endif