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