]> ncurses.scripts.mit.edu Git - ncurses.git/blob - ncurses/SigAction.h
ncurses 4.2
[ncurses.git] / ncurses / SigAction.h
1 /****************************************************************************
2  * Copyright (c) 1998 Free Software Foundation, Inc.                        *
3  *                                                                          *
4  * Permission is hereby granted, free of charge, to any person obtaining a  *
5  * copy of this software and associated documentation files (the            *
6  * "Software"), to deal in the Software without restriction, including      *
7  * without limitation the rights to use, copy, modify, merge, publish,      *
8  * distribute, distribute with modifications, sublicense, and/or sell       *
9  * copies of the Software, and to permit persons to whom the Software is    *
10  * furnished to do so, subject to the following conditions:                 *
11  *                                                                          *
12  * The above copyright notice and this permission notice shall be included  *
13  * in all copies or substantial portions of the Software.                   *
14  *                                                                          *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18  * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22  *                                                                          *
23  * Except as contained in this notice, the name(s) of the above copyright   *
24  * holders shall not be used in advertising or otherwise to promote the     *
25  * sale, use or other dealings in this Software without prior written       *
26  * authorization.                                                           *
27  ****************************************************************************/
28
29 /****************************************************************************
30  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
31  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
32  ****************************************************************************/
33
34 /*
35  * $Id: SigAction.h,v 1.4 1998/02/11 12:13:55 tom Exp $
36  *
37  * This file exists to handle non-POSIX systems which don't have <unistd.h>,
38  * and usually no sigaction() nor <termios.h>
39  */
40
41 #ifndef _SIGACTION_H
42 #define _SIGACTION_H
43
44 #if HAVE_SIGACTION
45
46 #if !HAVE_TYPE_SIGACTION
47 typedef struct sigaction sigaction_t;
48 #endif
49
50 #else   /* !HAVE_SIGACTION */
51
52 #if HAVE_SIGVEC
53
54 #if HAVE_LIBC_H
55 #include <libc.h>
56 #endif
57
58 #undef  SIG_BLOCK
59 #define SIG_BLOCK       00
60
61 #undef  SIG_UNBLOCK
62 #define SIG_UNBLOCK     01
63
64 #undef  SIG_SETMASK
65 #define SIG_SETMASK     02
66
67         /*
68          * <bsd/signal.h> is in the Linux 1.2.8 + gcc 2.7.0 configuration,
69          * and is useful for testing this header file.
70          */
71 #if HAVE_BSD_SIGNAL_H
72 #include <bsd/signal.h>
73 #endif
74
75 typedef struct sigvec sigaction_t;
76
77 #define sigset_t _nc_sigset_t
78 typedef unsigned long sigset_t;
79
80 #undef  sa_mask
81 #define sa_mask sv_mask
82 #undef  sa_handler
83 #define sa_handler sv_handler
84 #undef  sa_flags
85 #define sa_flags sv_flags
86
87 #undef  sigaction
88 #define sigaction   _nc_sigaction
89 #undef  sigprocmask
90 #define sigprocmask _nc_sigprocmask
91 #undef  sigemptyset
92 #define sigemptyset _nc_sigemptyset
93 #undef  sigsuspend
94 #define sigsuspend  _nc_sigsuspend
95 #undef  sigdelset
96 #define sigdelset   _nc_sigdelset
97 #undef  sigaddset
98 #define sigaddset   _nc_sigaddset
99
100 extern int sigaction (int sig, sigaction_t * sigact, sigaction_t *  osigact);
101 extern int sigprocmask (int how, sigset_t *mask, sigset_t *omask);
102 extern int sigemptyset (sigset_t *mask);
103 extern int sigsuspend (sigset_t *mask);
104 extern int sigdelset (sigset_t *mask, int sig);
105 extern int sigaddset (sigset_t *mask, int sig);
106
107 #endif /* HAVE_SIGVEC */
108 #endif /* HAVE_SIGACTION */
109 #endif /* !defined(_SIGACTION_H) */