home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c221 / 6.ddi / MWHC.006 / U < prev    next >
Encoding:
Text File  |  1992-12-09  |  3.6 KB  |  106 lines

  1. /*
  2.  *   signal.h -- ANSI 
  3.  *
  4.  *   Functions and macros for handling signals.
  5.  *
  6.  *           Copyright (c) 1990, MetaWare Incorporated
  7.  */
  8.  
  9. #ifndef _SIGNAL_H
  10. #define _SIGNAL_H
  11.  
  12. #ifdef __CPLUSPLUS__
  13. extern "C" {
  14. #endif
  15.  
  16. #define SIG_ERR         (void (*)(int))-1
  17. #define SIG_DFL         (void (*)(int))0
  18. #define SIG_IGN         (void (*)(int))1
  19. #ifdef _MSDOS
  20. # define SIG_ACK    (void (*)(int))-2
  21. #endif
  22.  
  23. typedef int    sig_atomic_t;
  24.  
  25. #if !defined(NSIG) && (!_AM29K && !_ISIS) || _NEXT
  26. #       define NSIG 32
  27. #elif !defined(_NSIG)
  28. #       define _NSIG    32
  29. #endif
  30.  
  31. #if (_NEXT || _ATT4)
  32. #define _NSIG NSIG
  33. #endif
  34.  
  35. #define    SIGHUP    1    /* hangup */
  36. #define    SIGINT    2    /* interrupt */
  37. #define    SIGQUIT    3    /* quit */
  38. #ifdef _MSDOS
  39. # define SIGBREAK SIGQUIT    /* Microsoft compatibility */
  40. #endif
  41. #define    SIGILL    4    /* illegal instruction (not reset when caught) */
  42. #define        ILL_RESAD_FAULT    0x0    /* reserved addressing fault */
  43. #define        ILL_PRIVIN_FAULT    0x1    /* privileged instruction fault */
  44. #define        ILL_RESOP_FAULT    0x2    /* reserved operand fault */
  45. #ifdef _MSDOS
  46. # define    ILL_EXPLICITGEN    0xf    /* generated by 'raise' */
  47. #endif
  48. /* CHME, CHMS, CHMU are not yet given back to users reasonably */
  49. #define    SIGTRAP    5    /* trace trap (not reset when caught) */
  50. #define    SIGIOT    6    /* IOT instruction */
  51. #define    SIGABRT    SIGIOT    /* compatibility */
  52. #define    SIGEMT    7    /* EMT instruction */
  53. #define    SIGFPE    8    /* floating point exception */
  54. #define        FPE_INTOVF_TRAP    0x1    /* integer overflow */
  55. #define        FPE_INTDIV_TRAP    0x2    /* integer divide by zero */
  56. #define        FPE_FLTOVF_TRAP    0x3    /* floating overflow */
  57. #define        FPE_FLTDIV_TRAP    0x4    /* floating/decimal divide by zero */
  58. #define        FPE_FLTUND_TRAP    0x5    /* floating underflow */
  59. #define        FPE_DECOVF_TRAP    0x6    /* decimal overflow */
  60. #define        FPE_SUBRNG_TRAP    0x7    /* subscript out of range */
  61. #define        FPE_FLTOVF_FAULT    0x8    /* floating overflow fault */
  62. #define        FPE_FLTDIV_FAULT    0x9    /* divide by zero floating fault */
  63. #define        FPE_FLTUND_FAULT    0xa    /* floating underflow fault */
  64. #ifdef _MSDOS
  65. # define    FPE_EXPLICITGEN    0xf    /* generated by 'raise' */
  66. #endif
  67. #define    SIGKILL    9    /* kill (cannot be caught or ignored) */
  68. #define    SIGBUS    10    /* bus error */
  69. #define    SIGSEGV    11    /* segmentation violation */
  70. #define    SIGSYS    12    /* bad argument to system call */
  71. #define    SIGPIPE    13    /* write on a pipe with no one to read it */
  72. #define    SIGALRM    14    /* alarm clock */
  73. #define    SIGTERM    15    /* software termination signal from kill */
  74. #define    SIGURG    16    /* urgent condition on IO channel */
  75. #define    SIGSTOP    17    /* sendable stop signal not from tty */
  76. #define    SIGTSTP    18    /* stop signal from tty */
  77. #define    SIGCONT    19    /* continue a stopped process */
  78. #define    SIGCHLD    20    /* to parent on child stop or exit */
  79. #define    SIGCLD    SIGCHLD    /* compatibility */
  80. #define    SIGTTIN    21    /* to readers pgrp upon background tty read */
  81. #define    SIGTTOU    22    /* like TTIN for output if (tp->t_local<OSTOP) */
  82. #define    SIGIO    23    /* input/output possible signal */
  83. #define    SIGXCPU    24    /* exceeded CPU time limit */
  84. #define    SIGXFSZ    25    /* exceeded file size limit */
  85. #define    SIGVTALRM 26    /* virtual time alarm */
  86. #define    SIGPROF    27    /* profiling time alarm */
  87. #define SIGWINCH 28    /* window size changes */
  88. #define SIGUSR1 30    /* user defined signal 1 */
  89. #define SIGUSR2 31    /* user defined signal 2 */
  90. #ifdef _MSDOS
  91. # define SIGUSR3 32    /* user defined signal 3, MS compatibility */
  92. #endif
  93.  
  94.  
  95. extern  void            (*signal(int __n, void (*__f)(int)))(int);
  96. extern  int             raise(int __n);
  97.  
  98. #ifdef _MSDOS 
  99.     extern int _kill(int __pid, int __sig);
  100. #endif
  101.  
  102. #ifdef __CPLUSPLUS__
  103. }
  104. #endif
  105. #endif /* _SIGNAL_H */
  106.