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