150276Speter/****************************************************************************
276726Speter * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
350276Speter *                                                                          *
450276Speter * Permission is hereby granted, free of charge, to any person obtaining a  *
550276Speter * copy of this software and associated documentation files (the            *
650276Speter * "Software"), to deal in the Software without restriction, including      *
750276Speter * without limitation the rights to use, copy, modify, merge, publish,      *
850276Speter * distribute, distribute with modifications, sublicense, and/or sell       *
950276Speter * copies of the Software, and to permit persons to whom the Software is    *
1050276Speter * furnished to do so, subject to the following conditions:                 *
1150276Speter *                                                                          *
1250276Speter * The above copyright notice and this permission notice shall be included  *
1350276Speter * in all copies or substantial portions of the Software.                   *
1450276Speter *                                                                          *
1550276Speter * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
1650276Speter * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
1750276Speter * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
1850276Speter * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
1950276Speter * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
2050276Speter * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
2150276Speter * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
2250276Speter *                                                                          *
2350276Speter * Except as contained in this notice, the name(s) of the above copyright   *
2450276Speter * holders shall not be used in advertising or otherwise to promote the     *
2550276Speter * sale, use or other dealings in this Software without prior written       *
2650276Speter * authorization.                                                           *
2750276Speter ****************************************************************************/
2850276Speter
2950276Speter/****************************************************************************
3050276Speter *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
3150276Speter *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
3250276Speter ****************************************************************************/
3350276Speter
3450276Speter/*
35166124Srafan * $Id: SigAction.h,v 1.8 2005/08/06 20:05:32 tom Exp $
3650276Speter *
3750276Speter * This file exists to handle non-POSIX systems which don't have <unistd.h>,
3850276Speter * and usually no sigaction() nor <termios.h>
3950276Speter */
4050276Speter
4150276Speter#ifndef _SIGACTION_H
4250276Speter#define _SIGACTION_H
4350276Speter
4450276Speter#ifndef HAVE_SIGACTION
4550276Speter#define HAVE_SIGACTION 0
4650276Speter#endif
4750276Speter
4850276Speter#ifndef HAVE_SIGVEC
4950276Speter#define HAVE_SIGVEC 0
5050276Speter#endif
5150276Speter
5250276Speter#if HAVE_SIGACTION
5350276Speter
5450276Speter#if !HAVE_TYPE_SIGACTION
5550276Spetertypedef struct sigaction sigaction_t;
5650276Speter#endif
5750276Speter
5850276Speter#else	/* !HAVE_SIGACTION */
5950276Speter
6050276Speter#if HAVE_SIGVEC
6150276Speter
6250276Speter#undef  SIG_BLOCK
6350276Speter#define SIG_BLOCK       00
6450276Speter
6550276Speter#undef  SIG_UNBLOCK
6650276Speter#define SIG_UNBLOCK     01
6750276Speter
6850276Speter#undef  SIG_SETMASK
6950276Speter#define SIG_SETMASK     02
7050276Speter
7150276Speter 	/*
7250276Speter	 * <bsd/signal.h> is in the Linux 1.2.8 + gcc 2.7.0 configuration,
7350276Speter	 * and is useful for testing this header file.
7450276Speter	 */
7550276Speter#if HAVE_BSD_SIGNAL_H
7650276Speter#include <bsd/signal.h>
7750276Speter#endif
7850276Speter
7950276Spetertypedef struct sigvec sigaction_t;
8050276Speter
8150276Speter#define sigset_t _nc_sigset_t
8250276Spetertypedef unsigned long sigset_t;
8350276Speter
8450276Speter#undef  sa_mask
8550276Speter#define sa_mask sv_mask
8650276Speter#undef  sa_handler
8750276Speter#define sa_handler sv_handler
8850276Speter#undef  sa_flags
8950276Speter#define sa_flags sv_flags
9050276Speter
9150276Speter#undef  sigaction
9250276Speter#define sigaction   _nc_sigaction
9350276Speter#undef  sigprocmask
9450276Speter#define sigprocmask _nc_sigprocmask
9550276Speter#undef  sigemptyset
9650276Speter#define sigemptyset _nc_sigemptyset
9750276Speter#undef  sigsuspend
9850276Speter#define sigsuspend  _nc_sigsuspend
9950276Speter#undef  sigdelset
10050276Speter#define sigdelset   _nc_sigdelset
10150276Speter#undef  sigaddset
10250276Speter#define sigaddset   _nc_sigaddset
10350276Speter
104166124Srafan/* tty/lib_tstp.c is the only user */
105166124Srafan#include <base/sigaction.c>
10650276Speter
10750276Speter#endif /* HAVE_SIGVEC */
10850276Speter#endif /* HAVE_SIGACTION */
10950276Speter#endif /* !defined(_SIGACTION_H) */
110