1 /***
2 *signal.h - defines signal values and routines
3 *
4 *           Copyright (c) Microsoft Corporation. All rights reserved.
5 *
6 *Purpose:
7 *           This file defines the signal values and declares the signal functions.
8 *           [ANSI/System V]
9 *
10 *           [Public]
11 *
12 ****/
13
14 #if        _MSC_VER > 1000
15 #pragma once
16 #endif
17
18 #ifndef _INC_SIGNAL
19 #define _INC_SIGNAL
20
21 #include <crtdefs.h>
22
23 #ifdef  __cplusplus
24 extern "C" {
25 #endif
26
27 /* Define __cdecl for non-Microsoft compilers */
28
29 #ifndef _SIG_ATOMIC_T_DEFINED
30 typedef int sig_atomic_t;
31 #define _SIG_ATOMIC_T_DEFINED
32 #endif
33
34 #define NSIG 23        /* maximum signal number + 1 */
35
36
37 /* Signal types */
38
39 #define SIGINT                2           /* interrupt */
40 #define SIGILL                4           /* illegal instruction - invalid function image */
41 #define SIGFPE                8           /* floating point exception */
42 #define SIGSEGV               11          /* segment violation */
43 #define SIGTERM               15          /* Software termination signal from kill */
44 #define SIGBREAK             21          /* Ctrl-Break sequence */
45 #define SIGABRT               22          /* abnormal termination triggered by abort call */
46
47 #define SIGABRT_COMPAT  6           /* SIGABRT compatible with other platforms, same as SIGABRT */
48
49 #ifndef _M_CEE_PURE
50 /* signal action codes */
51
52 #define SIG_DFL (void (__cdecl *)(int))0                  /* default signal action */
53 #define SIG_IGN (void (__cdecl *)(int))1                  /* ignore signal */
54 #define SIG_GET (void (__cdecl *)(int))2                  /* return current value */
55 #define SIG_SGE (void (__cdecl *)(int))3                  /* signal gets error */
56 #define SIG_ACK (void (__cdecl *)(int))4                  /* acknowledge */
57
58
59 /* signal error value (returned by signal call on error) */
Lines 60 ... 69 are skipped.
70
71
72 /* signal error value (returned by signal call on error) */
73
74 #define SIG_ERR (void (__clrcall *)(int))-1                /* signal error value */
75 #endif
76
77
78 /* pointer to exception information pointers structure */
79
80 #if        defined(_MT) || defined(_DLL)
81 extern void * * __cdecl __pxcptinfoptrs(void);
82 #define _pxcptinfoptrs  (*__pxcptinfoptrs())
83 #else     /* ndef _MT && ndef _DLL */
84 extern void * _pxcptinfoptrs;
85 #endif  /* _MT || _DLL */
86
87
88 /* Function prototypes */
89
90 #ifndef _M_CEE_PURE
91 _CRTIMP void (__cdecl * __cdecl signal(_In_ int _SigNum, _In_opt_ void (__cdecl * _Func)(int)))(int);
92 #endif
93
94 _CRTIMP int __cdecl raise(_In_ int _SigNum);
95
96 #if defined(_M_CEE) && defined(__cplusplus)
97 extern "C++"
98 {
99 _MRTIMP void (__clrcall * __cdecl signal(_In_ int _SigNum, _In_opt_ void (__clrcall * _Func)(int)))(int);
100 #ifndef _M_CEE_PURE
101 _MRTIMP void (__clrcall * __cdecl signal(_In_ int _SigNum, _In_ int))(int);
102 #endif
103 }
104 #endif
105
106 #ifdef  __cplusplus
107 }
108 #endif
109
110 #endif  /* _INC_SIGNAL */
111