blob: db96d0a5c58b40d466a92c2b577fb39853585291 [file] [log] [blame]
Darren Tucker9d30d132005-11-10 19:43:48 +11001/* $OpenBSD: SigAction.h,v 1.3 2001/01/22 18:01:32 millert Exp $ */
Damien Miller31abc9a2000-07-09 23:26:27 +10002
3/****************************************************************************
Darren Tucker9d30d132005-11-10 19:43:48 +11004 * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
Damien Miller31abc9a2000-07-09 23:26:27 +10005 * *
6 * Permission is hereby granted, free of charge, to any person obtaining a *
7 * copy of this software and associated documentation files (the *
8 * "Software"), to deal in the Software without restriction, including *
9 * without limitation the rights to use, copy, modify, merge, publish, *
10 * distribute, distribute with modifications, sublicense, and/or sell *
11 * copies of the Software, and to permit persons to whom the Software is *
12 * furnished to do so, subject to the following conditions: *
13 * *
14 * The above copyright notice and this permission notice shall be included *
15 * in all copies or substantial portions of the Software. *
16 * *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
20 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
21 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
22 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
23 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
24 * *
25 * Except as contained in this notice, the name(s) of the above copyright *
26 * holders shall not be used in advertising or otherwise to promote the *
27 * sale, use or other dealings in this Software without prior written *
28 * authorization. *
29 ****************************************************************************/
30
31/****************************************************************************
32 * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
33 * and: Eric S. Raymond <esr@snark.thyrsus.com> *
34 ****************************************************************************/
35
36/*
Darren Tucker9d30d132005-11-10 19:43:48 +110037 * $From: SigAction.h,v 1.6 2000/12/10 02:36:10 tom Exp $
Damien Miller31abc9a2000-07-09 23:26:27 +100038 *
39 * This file exists to handle non-POSIX systems which don't have <unistd.h>,
40 * and usually no sigaction() nor <termios.h>
41 */
42
Darren Tucker925d1de2005-11-10 16:31:55 +110043/* OPENBSD ORIGINAL: lib/libcurses/SigAction.h */
44
Damien Miller31abc9a2000-07-09 23:26:27 +100045#ifndef _SIGACTION_H
46#define _SIGACTION_H
47
48#if !defined(HAVE_SIGACTION) && defined(HAVE_SIGVEC)
49
50#undef SIG_BLOCK
51#define SIG_BLOCK 00
52
53#undef SIG_UNBLOCK
54#define SIG_UNBLOCK 01
55
56#undef SIG_SETMASK
57#define SIG_SETMASK 02
58
59/*
60 * <bsd/signal.h> is in the Linux 1.2.8 + gcc 2.7.0 configuration,
61 * and is useful for testing this header file.
62 */
63#if HAVE_BSD_SIGNAL_H
64# include <bsd/signal.h>
65#endif
66
67struct sigaction
68{
69 struct sigvec sv;
70};
71
Damien Miller31abc9a2000-07-09 23:26:27 +100072typedef unsigned long sigset_t;
73
74#undef sa_mask
Damien Millera4b9ed12000-07-11 12:55:49 +100075#define sa_mask sv.sv_mask
Damien Miller31abc9a2000-07-09 23:26:27 +100076#undef sa_handler
Damien Millera4b9ed12000-07-11 12:55:49 +100077#define sa_handler sv.sv_handler
Damien Miller31abc9a2000-07-09 23:26:27 +100078#undef sa_flags
Damien Millera4b9ed12000-07-11 12:55:49 +100079#define sa_flags sv.sv_flags
Damien Miller31abc9a2000-07-09 23:26:27 +100080
81int sigaction(int sig, struct sigaction *sigact, struct sigaction *osigact);
82int sigprocmask (int how, sigset_t *mask, sigset_t *omask);
83int sigemptyset (sigset_t *mask);
84int sigsuspend (sigset_t *mask);
85int sigdelset (sigset_t *mask, int sig);
86int sigaddset (sigset_t *mask, int sig);
87
88#endif /* !defined(HAVE_SIGACTION) && defined(HAVE_SIGVEC) */
89
90#endif /* !defined(_SIGACTION_H) */