home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / armlinux / alpha / PARTITIONS / USR_GZ / usr / include / signal.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-14  |  4.2 KB  |  147 lines

  1. /* Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3.  
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8.  
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. Library General Public License for more details.
  13.  
  14. You should have received a copy of the GNU Library General Public
  15. License along with the GNU C Library; see the file COPYING.LIB.  If
  16. not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
  17. Cambridge, MA 02139, USA.  */
  18.  
  19. /*
  20.  *    ANSI Standard: 4.7 SIGNAL HANDLING <signal.h>
  21.  */
  22.  
  23. #ifndef _SIGNAL_H
  24. #define _SIGNAL_H
  25.  
  26. #include <features.h>
  27. #include <sys/types.h>
  28. #include <linux/signal.h>
  29.  
  30. #ifndef SIGCLD
  31. #define SIGCLD        SIGCHLD
  32. #endif
  33.  
  34. typedef int sig_atomic_t;
  35.  
  36. typedef __sighandler_t    SignalHandler;
  37.  
  38. #ifndef BADSIG
  39. #define BADSIG        SIG_ERR
  40. #endif
  41.  
  42. /* The Interviews version also has these ... */
  43.  
  44. #define SignalBad    ((SignalHandler)-1)
  45. #define SignalDefault    ((SignalHandler)0)
  46. #define SignalIgnore    ((SignalHandler)1)
  47.  
  48. __BEGIN_DECLS
  49.  
  50. extern __const char * __const sys_siglist[];
  51. extern __const char * __const _sys_siglist[];
  52.  
  53. extern __sighandler_t
  54.         signal __P ((int __sig, __sighandler_t));
  55. extern int    raise __P ((int __sig));
  56. extern int    __kill __P ((pid_t __pid, int __sig));
  57. extern int    kill __P ((pid_t __pid, int __sig));
  58. extern int    killpg __P ((int __pgrp, int __sig));
  59. extern int    sigaddset __P ((sigset_t *__mask, int __sig));
  60. extern int    sigdelset __P ((sigset_t *__mask, int __sig));
  61. extern int    sigemptyset __P ((sigset_t *__mask));
  62. extern int    sigfillset __P ((sigset_t *__mask));
  63. extern int    sigismember __P ((__const sigset_t *__mask, int __sig));
  64. extern int    sigpending __P ((sigset_t *__set));
  65.  
  66. extern int    __sigprocmask __P ((int __how, __const sigset_t *__set,
  67.             sigset_t *__oldset));
  68. extern int    sigprocmask __P ((int __how, sigset_t *__set,
  69.             sigset_t *__oldset));
  70.  
  71. extern int    sigsuspend __P ((sigset_t *sigmask));
  72.  
  73. extern int    __sigaction __P ((int __sig, struct sigaction *__act,
  74.             struct sigaction *__oldact));
  75. extern int    sigaction __P ((int __sig, struct sigaction *__act,
  76.             struct sigaction *__oldact));
  77.  
  78. #define __sigemptyset(set)    ((*(set) = 0L), 0)
  79. #define __sigfillset(set)       ((*(set) = -1L), 0)
  80. #define __sigaddset(set, sig)   ((*(set) |= __sigmask (sig)), 0)
  81. #define __sigdelset(set, sig)   ((*(set) &= ~__sigmask (sig)), 0)
  82. #define __sigismember(set, sig) ((*(set) & __sigmask (sig)) ? 1 : 0)
  83.  
  84.  
  85. #ifdef __OPTIMIZE__
  86. #define sigemptyset    __sigemptyset
  87. #define sigfillset    __sigfillset
  88.  
  89. /* We don't do that any more since it causes problems due to
  90.  * "sig" > _NSIG and "sig" < 1. It isn't worth the touble to make
  91.  * them inline and static. Use __sigxxxxx if you want speed with
  92.  * correct "sig".
  93.  */
  94. #if 0
  95. #define sigaddset    __sigaddset
  96. #define sigdelset    __sigdelset
  97. #define sigismember    __sigismember
  98. #endif
  99.  
  100. #endif
  101.  
  102.  
  103. /* Return a mask that includes SIG only.  */
  104. #define __sigmask(sig)    (1 << ((sig) - 1))
  105.  
  106. extern int __sigsetmask __P ((int __mask));
  107. extern int __siggetmask __P ((void));
  108. extern int __sigblock __P ((int __mask));
  109. extern int __sigpause __P ((int __mask));
  110.  
  111. #ifdef  __USE_SVID
  112. /* SVID names for the same things.  */
  113. extern __sighandler_t ssignal __P ((int __sig, __sighandler_t __handler));
  114. extern int gsignal __P ((int __sig));
  115.  
  116. #endif /* Use SVID.  */
  117.  
  118. /* BSD */
  119. #ifdef __USE_BSD
  120. #define sigmask        __sigmask
  121.  
  122. extern int    sigblock __P ((int __mask));
  123. extern int    sigpause __P ((int __mask));
  124. extern int    sigsetmask __P ((int __mask));
  125. extern int    siggetmask __P ((void));
  126. extern void    psignal __P ((int __sig, __const char *__str));
  127.  
  128. extern int    siginterrupt __P ((int __sig, int __flag));
  129.  
  130. /* The `sig' bit is set if the interrupt on it
  131.  * is enabled via siginterrupt (). */
  132. extern sigset_t _sigintr;
  133.  
  134. #endif  /* Use BSD.  */
  135.  
  136. #ifdef __USE_BSD_SIGNAL
  137.  
  138. extern __sighandler_t
  139.         __bsd_signal __P ((int __sig, __sighandler_t));
  140. #define signal    __bsd_signal
  141.  
  142. #endif    /* __USE_BSD_SIGNAL */
  143.  
  144. __END_DECLS
  145.  
  146. #endif /* _SIGNAL_H */
  147.