svr4_signal.h revision 48620
143412Snewton/* 243412Snewton * Copyright (c) 1998 Mark Newton 343412Snewton * Copyright (c) 1994 Christos Zoulas 443412Snewton * All rights reserved. 543412Snewton * 643412Snewton * Redistribution and use in source and binary forms, with or without 743412Snewton * modification, are permitted provided that the following conditions 843412Snewton * are met: 943412Snewton * 1. Redistributions of source code must retain the above copyright 1043412Snewton * notice, this list of conditions and the following disclaimer. 1143412Snewton * 2. Redistributions in binary form must reproduce the above copyright 1243412Snewton * notice, this list of conditions and the following disclaimer in the 1343412Snewton * documentation and/or other materials provided with the distribution. 1443412Snewton * 3. The name of the author may not be used to endorse or promote products 1543412Snewton * derived from this software without specific prior written permission 1643412Snewton * 1743412Snewton * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1843412Snewton * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1943412Snewton * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2043412Snewton * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 2143412Snewton * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2243412Snewton * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2343412Snewton * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2443412Snewton * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2543412Snewton * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 2643412Snewton * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2743412Snewton */ 2843412Snewton 2943412Snewton#ifndef _SVR4_SIGNAL_H_ 3043412Snewton#define _SVR4_SIGNAL_H_ 3143412Snewton 3243412Snewton#include <i386/svr4/svr4_machdep.h> 3343412Snewton#include <svr4/svr4_siginfo.h> 3443412Snewton 3543412Snewton#define SVR4_SIGHUP 1 3643412Snewton#define SVR4_SIGINT 2 3743412Snewton#define SVR4_SIGQUIT 3 3843412Snewton#define SVR4_SIGILL 4 3943412Snewton#define SVR4_SIGTRAP 5 4043412Snewton#define SVR4_SIGIOT 6 4143412Snewton#define SVR4_SIGABRT 6 4243412Snewton#define SVR4_SIGEMT 7 4343412Snewton#define SVR4_SIGFPE 8 4443412Snewton#define SVR4_SIGKILL 9 4543412Snewton#define SVR4_SIGBUS 10 4643412Snewton#define SVR4_SIGSEGV 11 4743412Snewton#define SVR4_SIGSYS 12 4843412Snewton#define SVR4_SIGPIPE 13 4943412Snewton#define SVR4_SIGALRM 14 5043412Snewton#define SVR4_SIGTERM 15 5143412Snewton#define SVR4_SIGUSR1 16 5243412Snewton#define SVR4_SIGUSR2 17 5343412Snewton#define SVR4_SIGCLD 18 5443412Snewton#define SVR4_SIGCHLD 18 5543412Snewton#define SVR4_SIGPWR 19 5643412Snewton#define SVR4_SIGWINCH 20 5743412Snewton#define SVR4_SIGURG 21 5843412Snewton#define SVR4_SIGPOLL 22 5943412Snewton#define SVR4_SIGIO 22 6043412Snewton#define SVR4_SIGSTOP 23 6143412Snewton#define SVR4_SIGTSTP 24 6243412Snewton#define SVR4_SIGCONT 25 6343412Snewton#define SVR4_SIGTTIN 26 6443412Snewton#define SVR4_SIGTTOU 27 6543412Snewton#define SVR4_SIGVTALRM 28 6643412Snewton#define SVR4_SIGPROF 29 6743412Snewton#define SVR4_SIGXCPU 30 6843412Snewton#define SVR4_SIGXFSZ 31 6943412Snewton#define SVR4_NSIG 32 7043412Snewton 7143412Snewton#define SVR4_SIGNO_MASK 0x00FF 7243412Snewton#define SVR4_SIGNAL_MASK 0x0000 7343412Snewton#define SVR4_SIGDEFER_MASK 0x0100 7443412Snewton#define SVR4_SIGHOLD_MASK 0x0200 7543412Snewton#define SVR4_SIGRELSE_MASK 0x0400 7643412Snewton#define SVR4_SIGIGNORE_MASK 0x0800 7743412Snewton#define SVR4_SIGPAUSE_MASK 0x1000 7843412Snewton 7943412Snewtontypedef void (*svr4_sig_t) __P((int, svr4_siginfo_t *, void *)); 8043412Snewton#define SVR4_SIG_DFL (svr4_sig_t) 0 8143412Snewton#define SVR4_SIG_ERR (svr4_sig_t) -1 8243412Snewton#define SVR4_SIG_IGN (svr4_sig_t) 1 8343412Snewton#define SVR4_SIG_HOLD (svr4_sig_t) 2 8443412Snewton 8543412Snewton#define SVR4_SIGNO(a) ((a) & SVR4_SIGNO_MASK) 8643412Snewton#define SVR4_SIGCALL(a) ((a) & ~SVR4_SIGNO_MASK) 8743412Snewton 8843412Snewton#define SVR4_SIG_BLOCK 1 8943412Snewton#define SVR4_SIG_UNBLOCK 2 9043412Snewton#define SVR4_SIG_SETMASK 3 9143412Snewton 9243412Snewtontypedef struct { 9343412Snewton u_long bits[4]; 9443412Snewton} svr4_sigset_t; 9543412Snewton 9643412Snewtonstruct svr4_sigaction { 9748620Scracauer int ssa_flags; 9848620Scracauer svr4_sig_t ssa_handler; 9948620Scracauer svr4_sigset_t ssa_mask; 10048620Scracauer int ssa_reserved[2]; 10143412Snewton}; 10243412Snewton 10343412Snewtonstruct svr4_sigaltstack { 10443412Snewton char *ss_sp; 10543412Snewton int ss_size; 10643412Snewton int ss_flags; 10743412Snewton}; 10843412Snewton 10943412Snewton/* sa_flags */ 11043412Snewton#define SVR4_SA_ONSTACK 0x00000001 11143412Snewton#define SVR4_SA_RESETHAND 0x00000002 11243412Snewton#define SVR4_SA_RESTART 0x00000004 11343412Snewton#define SVR4_SA_SIGINFO 0x00000008 11443412Snewton#define SVR4_SA_NODEFER 0x00000010 11543412Snewton#define SVR4_SA_NOCLDWAIT 0x00010000 /* No zombies */ 11643412Snewton#define SVR4_SA_NOCLDSTOP 0x00020000 /* No jcl */ 11743412Snewton#define SVR4_SA_ALLBITS 0x0003001f 11843412Snewton 11943412Snewton/* ss_flags */ 12043412Snewton#define SVR4_SS_ONSTACK 0x00000001 12143412Snewton#define SVR4_SS_DISABLE 0x00000002 12243412Snewton#define SVR4_SS_ALLBITS 0x00000003 12343412Snewton 12443412Snewtonvoid bsd_to_svr4_sigaltstack __P((const struct sigaltstack *, struct svr4_sigaltstack *)); 12543412Snewtonvoid bsd_to_svr4_sigset __P((const sigset_t *, svr4_sigset_t *)); 12643412Snewtonvoid svr4_to_bsd_sigaltstack __P((const struct svr4_sigaltstack *, struct sigaltstack *)); 12743412Snewtonvoid svr4_to_bsd_sigset __P((const svr4_sigset_t *, sigset_t *)); 12843412Snewtonvoid svr4_sendsig(sig_t, int, int, u_long); 12943412Snewton 13043412Snewton#endif /* !_SVR4_SIGNAL_H_ */ 131