home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / signal.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  5.0 KB  |  174 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. #ifndef _SYS_SIGNAL_H
  11. #define _SYS_SIGNAL_H
  12.  
  13. #ident    "@(#)/usr/include/sys/signal.h.sl 1.1 4.0 12/08/90 16336 AT&T-USL"
  14.  
  15. #define    SIGHUP    1    /* hangup */
  16. #define    SIGINT    2    /* interrupt (rubout) */
  17. #define    SIGQUIT    3    /* quit (ASCII FS) */
  18. #define    SIGILL    4    /* illegal instruction (not reset when caught) */
  19. #define    SIGTRAP    5    /* trace trap (not reset when caught) */
  20. #define    SIGIOT    6    /* IOT instruction */
  21. #define SIGABRT 6    /* used by abort, replace SIGIOT in the future */
  22. #define    SIGEMT    7    /* EMT instruction */
  23. #define    SIGFPE    8    /* floating point exception */
  24. #define    SIGKILL    9    /* kill (cannot be caught or ignored) */
  25. #define    SIGBUS    10    /* bus error */
  26. #define    SIGSEGV    11    /* segmentation violation */
  27. #define    SIGSYS    12    /* bad argument to system call */
  28. #define    SIGPIPE    13    /* write on a pipe with no one to read it */
  29. #define    SIGALRM    14    /* alarm clock */
  30. #define    SIGTERM    15    /* software termination signal from kill */
  31. #define    SIGUSR1    16    /* user defined signal 1 */
  32. #define    SIGUSR2    17    /* user defined signal 2 */
  33. #define    SIGCLD    18    /* child status change */
  34. #define    SIGCHLD    18    /* child status change alias (POSIX) */
  35. #define    SIGPWR    19    /* power-fail restart */
  36. #define SIGWINCH 20    /* window size change */
  37. #define SIGURG    21    /* urgent socket condition */
  38. #define SIGPOLL 22    /* pollable event occured */
  39. #define SIGIO    22    /* socket I/O possible (SIGPOLL alias) */
  40. #define SIGSTOP 23    /* stop (cannot be caught or ignored) */
  41. #define SIGTSTP 24    /* user stop requested from tty */
  42. #define SIGCONT 25    /* stopped process has been continued */
  43. #define SIGTTIN 26    /* background tty read attempted */
  44. #define SIGTTOU 27    /* background tty write attempted */
  45. #define SIGVTALRM 28    /* virtual timer expired */
  46. #define SIGPROF 29    /* profiling timer expired */
  47. #define SIGXCPU 30    /* exceeded cpu limit */
  48. #define SIGXFSZ 31    /* exceeded file size limit */
  49.  
  50. #define    SIG_DFL    (void(*)())0
  51.  
  52. #if defined(lint)
  53. #define SIG_ERR (void(*)())0
  54. #define    SIG_IGN    (void (*)())0
  55. #define SIG_HOLD (void(*)())0
  56. #else
  57. #define SIG_ERR    (void(*)())-1
  58. #define    SIG_IGN    (void (*)())1
  59. #define SIG_HOLD (void(*)())2
  60. #endif
  61.  
  62. #define SIG_BLOCK    1
  63. #define SIG_UNBLOCK    2
  64. #define SIG_SETMASK    3
  65.  
  66. #define SIGNO_MASK    0xFF
  67. #define SIGDEFER    0x100
  68. #define SIGHOLD        0x200
  69. #define SIGRELSE    0x400
  70. #define SIGIGNORE    0x800
  71. #define SIGPAUSE    0x1000
  72.  
  73. #if (__STDC__ - 0 == 0) || defined(_POSIX_SOURCE)
  74. typedef struct {        /* signal set type */
  75.     unsigned long    sigbits[4];
  76. } sigset_t;
  77.  
  78. struct sigaction {
  79.     int sa_flags;
  80.     void (*sa_handler)();
  81.     sigset_t sa_mask;
  82.     int sa_resv[2];
  83. };
  84.  
  85. /* these are only valid for SIGCLD */
  86. #define SA_NOCLDSTOP    0x00020000    /* don't send job control SIGCLD's */
  87. #endif
  88.  
  89. #if (__STDC__ - 0 == 0) && !defined(_POSIX_SOURCE)
  90.             /* non-comformant ANSI compilation    */
  91.  
  92. /* definitions for the sa_flags field */
  93. #define SA_ONSTACK    0x00000001
  94. #define SA_RESETHAND    0x00000002
  95. #define SA_RESTART    0x00000004
  96. #define SA_SIGINFO    0x00000008
  97. #define SA_NODEFER    0x00000010
  98.  
  99. /* these are only valid for SIGCLD */
  100. #define SA_NOCLDWAIT    0x00010000    /* don't save zombie children     */
  101.  
  102. #define NSIG    32    /* valid signals range from 1 to NSIG-1 */
  103. #define MAXSIG    32    /* size of u_signal[], NSIG-1 <= MAXSIG */
  104.  
  105. #define S_SIGNAL    1
  106. #define S_SIGSET    2
  107. #define S_SIGACTION    3
  108. #define S_NONE        4
  109.  
  110. #define MINSIGSTKSZ    512
  111. #define SIGSTKSZ    8192
  112.  
  113. #define SS_ONSTACK    0x00000001
  114. #define SS_DISABLE    0x00000002
  115.  
  116. struct sigaltstack {
  117.     char    *ss_sp;
  118.     int    ss_size;
  119.     int    ss_flags;
  120. };
  121.  
  122. typedef struct sigaltstack stack_t;
  123.  
  124. #endif
  125.  
  126. #ifdef _KERNEL 
  127.  
  128. extern k_sigset_t    
  129.  
  130.     fillset,        /* valid signals, guaranteed contiguous */
  131.     holdvfork,        /* held while doing vfork */
  132.     cantmask,        /* cannot be caught or ignored */
  133.     cantreset,        /* cannot be reset after catching */
  134.     ignoredefault,        /* ignored by default */
  135.     stopdefault,        /* stop by default */
  136.     coredefault;        /* dumps core by default */
  137.  
  138. #define    sigmask(n)        ((unsigned long)1 << ((n) - 1))
  139.  
  140. #define sigemptyset(s)        (*(s) = 0)
  141. #define sigfillset(s)        (*(s) = fillset)
  142. #define sigaddset(s,n)        (*(s) |= sigmask(n))
  143. #define sigdelset(s,n)        (*(s) &= ~sigmask(n))
  144. #define    sigismember(s,n)    (sigmask(n) & *(s))
  145. #if !defined(_POSIX_SOURCE) 
  146. #define sigisempty(s)        (*(s) == 0)
  147. #define sigorset(s1,s2)        (*(s1) |= *(s2))
  148. #define    sigandset(s1,s2)    (*(s1) &= *(s2))
  149. #define    sigdiffset(s1,s2)    (*(s1) &= ~(*(s2)))
  150. #define sigutok(us,ks)        (*(ks) = (us)->sigbits[0])
  151. #define sigktou(ks,us)        ((us)->sigbits[0] = *(ks),    \
  152.                  (us)->sigbits[1] = 0,    \
  153.                  (us)->sigbits[2] = 0,    \
  154.                  (us)->sigbits[3] = 0)
  155.  
  156. #endif /* !defined(_POSIX_SOURCE) */ 
  157. typedef struct {
  158.     int    sig;
  159.     int    perm;
  160.     int    checkperm;
  161. } sigsend_t;
  162.  
  163. #if !defined(_POSIX_SOURCE) 
  164. #if defined(__STDC__)
  165. extern void setsigact(int, void (*)(), k_sigset_t, int);
  166. #else
  167. extern void setsigact();
  168. #endif    /* __STDC__ */
  169. #endif /* !defined(_POSIX_SOURCE) */ 
  170.  
  171. #endif /* _KERNEL */
  172.  
  173. #endif /* _SYS_SIGNAL_H */
  174.