1 // 2 // stdio.h 3 // 4 // Copyright (c) Microsoft Corporation. All rights reserved. 5 // 6 // The C Standard Library <signal.h> header. 7 // 8 #pragma once 9 #ifndef _INC_SIGNAL // include guard for 3rd party interop 10 #define _INC_SIGNAL 11 12 #include <corecrt.h> 13 14 #pragma warning(push) 15 #pragma warning(disable: _UCRT_DISABLED_WARNINGS) 16 _UCRT_DISABLE_CLANG_WARNINGS 17 18 _CRT_BEGIN_C_HEADER 19 20 21 22 typedef int sig_atomic_t; 23 24 typedef void (__CRTDECL* _crt_signal_t)(int); 25 26 #define NSIG 23 // maximum signal number + 1 27 28 // Signal types 29 #define SIGINT 2 // interrupt 30 #define SIGILL 4 // illegal instruction - invalid function image 31 #define SIGFPE 8 // floating point exception 32 #define SIGSEGV 11 // segment violation 33 #define SIGTERM 15 // Software termination signal from kill 34 #define SIGBREAK 21 // Ctrl-Break sequence 35 #define SIGABRT 22 // abnormal termination triggered by abort call 36 37 #define SIGABRT_COMPAT 6 // SIGABRT compatible with other platforms, same as SIGABRT 38 39 // Signal action codes 40 #define SIG_DFL ((_crt_signal_t)0) // default signal action 41 #define SIG_IGN ((_crt_signal_t)1) // ignore signal 42 #define SIG_GET ((_crt_signal_t)2) // return current value 43 #define SIG_SGE ((_crt_signal_t)3) // signal gets error 44 #define SIG_ACK ((_crt_signal_t)4) // acknowledge 45 46 #ifdef _CORECRT_BUILD 47 // Internal use only! Not valid as an argument to signal(). 48 #define SIG_DIE ((_crt_signal_t)5) // terminate process 49 #endif 50 51 // Signal error value (returned by signal call on error) 52 #define SIG_ERR ((_crt_signal_t)-1) // signal error value 53 54 55 56 // Pointer to exception information pointers structure 57 _ACRTIMP void** __cdecl __pxcptinfoptrs(void); 58 #define _pxcptinfoptrs (*__pxcptinfoptrs()) 59 60 // Function prototypes 61 #ifndef _M_CEE_PURE 62 _ACRTIMP _crt_signal_t __cdecl signal(_In_ int _Signal, _In_opt_ _crt_signal_t _Function); 63 #endif 64 65 _ACRTIMP int __cdecl raise(_In_ int _Signal); 66 67 68 69 _CRT_END_C_HEADER 70 _UCRT_RESTORE_CLANG_WARNINGS 71 #pragma warning(pop) // _UCRT_DISABLED_WARNINGS 72 #endif // _INC_SIGNAL 73