SigAction.h revision 302408
1207618Srdivacky/****************************************************************************
2207618Srdivacky * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
3207618Srdivacky *                                                                          *
4207618Srdivacky * Permission is hereby granted, free of charge, to any person obtaining a  *
5207618Srdivacky * copy of this software and associated documentation files (the            *
6207618Srdivacky * "Software"), to deal in the Software without restriction, including      *
7207618Srdivacky * without limitation the rights to use, copy, modify, merge, publish,      *
8207618Srdivacky * distribute, distribute with modifications, sublicense, and/or sell       *
9207618Srdivacky * copies of the Software, and to permit persons to whom the Software is    *
10207618Srdivacky * furnished to do so, subject to the following conditions:                 *
11207618Srdivacky *                                                                          *
12207618Srdivacky * The above copyright notice and this permission notice shall be included  *
13207618Srdivacky * in all copies or substantial portions of the Software.                   *
14207618Srdivacky *                                                                          *
15207618Srdivacky * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16252723Sdim * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17252723Sdim * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18207618Srdivacky * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19252723Sdim * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20245431Sdim * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21252723Sdim * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22207618Srdivacky *                                                                          *
23207618Srdivacky * Except as contained in this notice, the name(s) of the above copyright   *
24252723Sdim * holders shall not be used in advertising or otherwise to promote the     *
25245431Sdim * sale, use or other dealings in this Software without prior written       *
26245431Sdim * authorization.                                                           *
27245431Sdim ****************************************************************************/
28207618Srdivacky
29207618Srdivacky/****************************************************************************
30207618Srdivacky *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
31207618Srdivacky *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
32252723Sdim ****************************************************************************/
33252723Sdim
34207618Srdivacky/*
35252723Sdim * $Id: SigAction.h,v 1.8 2005/08/06 20:05:32 tom Exp $
36252723Sdim *
37252723Sdim * This file exists to handle non-POSIX systems which don't have <unistd.h>,
38252723Sdim * and usually no sigaction() nor <termios.h>
39252723Sdim */
40252723Sdim
41252723Sdim#ifndef _SIGACTION_H
42252723Sdim#define _SIGACTION_H
43252723Sdim
44207618Srdivacky#ifndef HAVE_SIGACTION
45252723Sdim#define HAVE_SIGACTION 0
46252723Sdim#endif
47252723Sdim
48252723Sdim#ifndef HAVE_SIGVEC
49252723Sdim#define HAVE_SIGVEC 0
50252723Sdim#endif
51252723Sdim
52252723Sdim#if HAVE_SIGACTION
53252723Sdim
54252723Sdim#if !HAVE_TYPE_SIGACTION
55252723Sdimtypedef struct sigaction sigaction_t;
56252723Sdim#endif
57252723Sdim
58252723Sdim#else	/* !HAVE_SIGACTION */
59252723Sdim
60252723Sdim#if HAVE_SIGVEC
61252723Sdim
62252723Sdim#undef  SIG_BLOCK
63252723Sdim#define SIG_BLOCK       00
64252723Sdim
65252723Sdim#undef  SIG_UNBLOCK
66252723Sdim#define SIG_UNBLOCK     01
67252723Sdim
68252723Sdim#undef  SIG_SETMASK
69252723Sdim#define SIG_SETMASK     02
70252723Sdim
71252723Sdim 	/*
72252723Sdim	 * <bsd/signal.h> is in the Linux 1.2.8 + gcc 2.7.0 configuration,
73245431Sdim	 * and is useful for testing this header file.
74245431Sdim	 */
75207618Srdivacky#if HAVE_BSD_SIGNAL_H
76207618Srdivacky#include <bsd/signal.h>
77207618Srdivacky#endif
78207618Srdivacky
79252723Sdimtypedef struct sigvec sigaction_t;
80252723Sdim
81252723Sdim#define sigset_t _nc_sigset_t
82252723Sdimtypedef unsigned long sigset_t;
83252723Sdim
84207618Srdivacky#undef  sa_mask
85252723Sdim#define sa_mask sv_mask
86252723Sdim#undef  sa_handler
87252723Sdim#define sa_handler sv_handler
88252723Sdim#undef  sa_flags
89252723Sdim#define sa_flags sv_flags
90252723Sdim
91207618Srdivacky#undef  sigaction
92207618Srdivacky#define sigaction   _nc_sigaction
93207618Srdivacky#undef  sigprocmask
94252723Sdim#define sigprocmask _nc_sigprocmask
95252723Sdim#undef  sigemptyset
96252723Sdim#define sigemptyset _nc_sigemptyset
97252723Sdim#undef  sigsuspend
98252723Sdim#define sigsuspend  _nc_sigsuspend
99252723Sdim#undef  sigdelset
100252723Sdim#define sigdelset   _nc_sigdelset
101252723Sdim#undef  sigaddset
102252723Sdim#define sigaddset   _nc_sigaddset
103252723Sdim
104252723Sdim/* tty/lib_tstp.c is the only user */
105252723Sdim#include <base/sigaction.c>
106252723Sdim
107252723Sdim#endif /* HAVE_SIGVEC */
108252723Sdim#endif /* HAVE_SIGACTION */
109252723Sdim#endif /* !defined(_SIGACTION_H) */
110252723Sdim