Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

164 lines
5.7 KiB

  1. /***
  2. *signal.h - defines signal values and routines
  3. *
  4. * Copyright (c) 1985-2001, 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. *Revision History:
  13. * 06-03-87 JMB Added MSSDK_ONLY comment on OS/2 related constants
  14. * 06-08-87 JCR Changed SIG_RRR to SIG_SGE
  15. * 08-07-87 SKS Signal handlers are now of type "void", not "int"
  16. * 10/20/87 JCR Removed "MSC40_ONLY" entries and "MSSDK_ONLY" comments
  17. * 12-11-87 JCR Added "_loadds" functionality
  18. * 12-18-87 JCR Added _FAR_ to declarations
  19. * 02-10-88 JCR Cleaned up white space
  20. * 08-22-88 GJF Modified to also work for the 386 (small model only)
  21. * 12-06-88 SKS Add _CDECL to SIG_DFL, SIG_IGN, SIG_SGE, SIG_ACK
  22. * 05-03-89 JCR Added _INTERNAL_IFSTRIP for relinc usage
  23. * 08-15-89 GJF Cleanup, now specific to OS/2 2.0 (i.e., 386 flat model)
  24. * 10-30-89 GJF Fixed copyright
  25. * 11-02-89 JCR Changed "DLL" to "_DLL"
  26. * 03-01-90 GJF Added #ifndef _INC_SIGNAL and #include <cruntime.h>
  27. * stuff. Also, removed some (now) useless preprocessor
  28. * directives.
  29. * 03-15-90 GJF Replaced _cdecl with _CALLTYPE1 in #defines and
  30. * prototypes.
  31. * 07-27-90 GJF Added definition for SIG_DIE (internal action code,
  32. * not valid as an argument to signal()).
  33. * 09-25-90 GJF Added _pxcptinfoptrs stuff.
  34. * 10-09-90 GJF Added arg type specification (int) to pointer-to-
  35. * signal-handler-type usages
  36. * 08-20-91 JCR C++ and ANSI naming
  37. * 07-17-92 GJF Removed unsupported signals: SIGUSR1, SIGUSR2, SIGUSR3.
  38. * 08-05-92 GJF Function calling type and variable type macros.
  39. * 01-21-93 GJF Removed support for C6-386's _cdecl.
  40. * 04-06-93 SKS Replace __cdecl/2 with __cdecl, _CRTVAR1 with nothing
  41. * 04-07-93 SKS Add _CRTIMP keyword for CRT DLL model
  42. * 10-12-93 GJF Support NT and Cuda versions. Replaced MTHREAD with
  43. * _MT.
  44. * 06-06-94 SKS Change if def(_MT) to if def(_MT) || def(_DLL)
  45. * This will support single-thread apps using MSVCRT*.DLL
  46. * 02-11-95 CFW Add _CRTBLD to avoid users getting wrong headers.
  47. * 02-14-95 CFW Clean up Mac merge.
  48. * 12-14-95 JWM Add "#pragma once".
  49. * 02-24-97 GJF Cleaned out obsolete support for _NTSDK. Also,
  50. * detab-ed.
  51. * 09-30-97 JWM Restored not-so-obsolete _CRTAPI1 support.
  52. * 10-07-97 RDL Added IA64.
  53. * 05-13-99 PML Remove _CRTAPI1
  54. * 05-17-99 PML Remove all Macintosh support.
  55. *
  56. ****/
  57. #if _MSC_VER > 1000 /*IFSTRIP=IGN*/
  58. #pragma once
  59. #endif
  60. #ifndef _INC_SIGNAL
  61. #define _INC_SIGNAL
  62. #if !defined(_WIN32)
  63. #error ERROR: Only Win32 target supported!
  64. #endif
  65. #ifndef _CRTBLD
  66. /* This version of the header files is NOT for user programs.
  67. * It is intended for use when building the C runtimes ONLY.
  68. * The version intended for public use will not have this message.
  69. */
  70. #error ERROR: Use of C runtime library internal header file.
  71. #endif /* _CRTBLD */
  72. #ifdef __cplusplus
  73. extern "C" {
  74. #endif
  75. #ifndef _INTERNAL_IFSTRIP_
  76. #include <cruntime.h>
  77. #endif /* _INTERNAL_IFSTRIP_ */
  78. /* Define _CRTIMP */
  79. #ifndef _CRTIMP
  80. #ifdef CRTDLL
  81. #define _CRTIMP __declspec(dllexport)
  82. #else /* ndef CRTDLL */
  83. #ifdef _DLL
  84. #define _CRTIMP __declspec(dllimport)
  85. #else /* ndef _DLL */
  86. #define _CRTIMP
  87. #endif /* _DLL */
  88. #endif /* CRTDLL */
  89. #endif /* _CRTIMP */
  90. /* Define __cdecl for non-Microsoft compilers */
  91. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  92. #define __cdecl
  93. #endif
  94. #ifndef _SIG_ATOMIC_T_DEFINED
  95. typedef int sig_atomic_t;
  96. #define _SIG_ATOMIC_T_DEFINED
  97. #endif
  98. #define NSIG 23 /* maximum signal number + 1 */
  99. /* Signal types */
  100. #define SIGINT 2 /* interrupt */
  101. #define SIGILL 4 /* illegal instruction - invalid function image */
  102. #define SIGFPE 8 /* floating point exception */
  103. #define SIGSEGV 11 /* segment violation */
  104. #define SIGTERM 15 /* Software termination signal from kill */
  105. #define SIGBREAK 21 /* Ctrl-Break sequence */
  106. #define SIGABRT 22 /* abnormal termination triggered by abort call */
  107. /* signal action codes */
  108. #define SIG_DFL (void (__cdecl *)(int))0 /* default signal action */
  109. #define SIG_IGN (void (__cdecl *)(int))1 /* ignore signal */
  110. #define SIG_SGE (void (__cdecl *)(int))3 /* signal gets error */
  111. #define SIG_ACK (void (__cdecl *)(int))4 /* acknowledge */
  112. #ifndef _INTERNAL_IFSTRIP_
  113. /* internal use only! not valid as an argument to signal() */
  114. #define SIG_GET (void (__cdecl *)(int))2 /* accept signal */
  115. #define SIG_DIE (void (__cdecl *)(int))5 /* terminate process */
  116. #endif
  117. /* signal error value (returned by signal call on error) */
  118. #define SIG_ERR (void (__cdecl *)(int))-1 /* signal error value */
  119. /* pointer to exception information pointers structure */
  120. #if defined(_MT) || defined(_DLL)
  121. extern void * * __cdecl __pxcptinfoptrs(void);
  122. #define _pxcptinfoptrs (*__pxcptinfoptrs())
  123. #else /* ndef _MT && ndef _DLL */
  124. extern void * _pxcptinfoptrs;
  125. #endif /* _MT || _DLL */
  126. /* Function prototypes */
  127. _CRTIMP void (__cdecl * __cdecl signal(int, void (__cdecl *)(int)))(int);
  128. _CRTIMP int __cdecl raise(int);
  129. #ifdef __cplusplus
  130. }
  131. #endif
  132. #endif /* _INC_SIGNAL */