1*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 2*0Sstevel@tonic-gate 3*0Sstevel@tonic-gate /* 4*0Sstevel@tonic-gate * Copyright (c) 1982 Regents of the University of California. 5*0Sstevel@tonic-gate * All rights reserved. The Berkeley software License Agreement 6*0Sstevel@tonic-gate * specifies the terms and conditions for redistribution. 7*0Sstevel@tonic-gate * 8*0Sstevel@tonic-gate * Copyright (c) 1987 by Sun Microsystems, Inc. 9*0Sstevel@tonic-gate */ 10*0Sstevel@tonic-gate 11*0Sstevel@tonic-gate #ifndef __signal_h 12*0Sstevel@tonic-gate #define __signal_h 13*0Sstevel@tonic-gate 14*0Sstevel@tonic-gate #ifndef _POSIX_SOURCE 15*0Sstevel@tonic-gate #include <sys/signal.h> 16*0Sstevel@tonic-gate #else 17*0Sstevel@tonic-gate /* 18*0Sstevel@tonic-gate * All of the below is drawn from sys/signal.h. Adding anything here means you 19*0Sstevel@tonic-gate * add it in sys/signal.h as well. 20*0Sstevel@tonic-gate */ 21*0Sstevel@tonic-gate #define SIGHUP 1 /* hangup */ 22*0Sstevel@tonic-gate #define SIGINT 2 /* interrupt */ 23*0Sstevel@tonic-gate #define SIGQUIT 3 /* quit */ 24*0Sstevel@tonic-gate #define SIGILL 4 /* illegal instruction (not reset when caught) */ 25*0Sstevel@tonic-gate #define SIGTRAP 5 /* trace trap (not reset when caught) */ 26*0Sstevel@tonic-gate #define SIGIOT 6 /* IOT instruction */ 27*0Sstevel@tonic-gate #define SIGABRT 6 /* used by abort, replace SIGIOT in the future */ 28*0Sstevel@tonic-gate #define SIGEMT 7 /* EMT instruction */ 29*0Sstevel@tonic-gate #define SIGFPE 8 /* floating point exception */ 30*0Sstevel@tonic-gate #define SIGKILL 9 /* kill (cannot be caught or ignored) */ 31*0Sstevel@tonic-gate #define SIGBUS 10 /* bus error */ 32*0Sstevel@tonic-gate #define SIGSEGV 11 /* segmentation violation */ 33*0Sstevel@tonic-gate #define SIGSYS 12 /* bad argument to system call */ 34*0Sstevel@tonic-gate #define SIGPIPE 13 /* write on a pipe with no one to read it */ 35*0Sstevel@tonic-gate #define SIGALRM 14 /* alarm clock */ 36*0Sstevel@tonic-gate #define SIGTERM 15 /* software termination signal from kill */ 37*0Sstevel@tonic-gate #define SIGURG 16 /* urgent condition on IO channel */ 38*0Sstevel@tonic-gate #define SIGSTOP 17 /* sendable stop signal not from tty */ 39*0Sstevel@tonic-gate #define SIGTSTP 18 /* stop signal from tty */ 40*0Sstevel@tonic-gate #define SIGCONT 19 /* continue a stopped process */ 41*0Sstevel@tonic-gate #define SIGCHLD 20 /* to parent on child stop or exit */ 42*0Sstevel@tonic-gate #define SIGCLD 20 /* System V name for SIGCHLD */ 43*0Sstevel@tonic-gate #define SIGTTIN 21 /* to readers pgrp upon background tty read */ 44*0Sstevel@tonic-gate #define SIGTTOU 22 /* like TTIN for output if (tp->t_local<OSTOP) */ 45*0Sstevel@tonic-gate #define SIGIO 23 /* input/output possible signal */ 46*0Sstevel@tonic-gate #define SIGPOLL SIGIO /* System V name for SIGIO */ 47*0Sstevel@tonic-gate #define SIGXCPU 24 /* exceeded CPU time limit */ 48*0Sstevel@tonic-gate #define SIGXFSZ 25 /* exceeded file size limit */ 49*0Sstevel@tonic-gate #define SIGVTALRM 26 /* virtual time alarm */ 50*0Sstevel@tonic-gate #define SIGPROF 27 /* profiling time alarm */ 51*0Sstevel@tonic-gate #define SIGWINCH 28 /* window changed */ 52*0Sstevel@tonic-gate #define SIGLOST 29 /* resource lost (eg, record-lock lost) */ 53*0Sstevel@tonic-gate #define SIGUSR1 30 /* user defined signal 1 */ 54*0Sstevel@tonic-gate #define SIGUSR2 31 /* user defined signal 2 */ 55*0Sstevel@tonic-gate 56*0Sstevel@tonic-gate /* signal() args & returns */ 57*0Sstevel@tonic-gate #define SIG_ERR (void (*)())-1 58*0Sstevel@tonic-gate #define SIG_DFL (void (*)())0 59*0Sstevel@tonic-gate #define SIG_IGN (void (*)())1 60*0Sstevel@tonic-gate #define SIG_HOLD (void (*)())3 61*0Sstevel@tonic-gate 62*0Sstevel@tonic-gate /* sigprocmask flags */ 63*0Sstevel@tonic-gate #define SIG_BLOCK 0x0001 64*0Sstevel@tonic-gate #define SIG_UNBLOCK 0x0002 65*0Sstevel@tonic-gate #define SIG_SETMASK 0x0004 66*0Sstevel@tonic-gate 67*0Sstevel@tonic-gate /* sa_flags flag; also supports all the sigvec flags in sys/signal.h */ 68*0Sstevel@tonic-gate #define SA_NOCLDSTOP 0x0008 /* don't send a SIGCHLD on child stop */ 69*0Sstevel@tonic-gate 70*0Sstevel@tonic-gate #include <sys/stdtypes.h> /* for sigset_t */ 71*0Sstevel@tonic-gate 72*0Sstevel@tonic-gate struct sigaction { 73*0Sstevel@tonic-gate void (*sa_handler)(); 74*0Sstevel@tonic-gate sigset_t sa_mask; 75*0Sstevel@tonic-gate int sa_flags; 76*0Sstevel@tonic-gate }; 77*0Sstevel@tonic-gate void (*signal())(); 78*0Sstevel@tonic-gate int kill(/* pid_t p, int sig */); 79*0Sstevel@tonic-gate int sigaction(/* int signo, 80*0Sstevel@tonic-gate struct sigaction *act, struct sigaction *oldact */); 81*0Sstevel@tonic-gate int sigaddset(/* sigset_t *mask, int signo */); 82*0Sstevel@tonic-gate int sigdelset(/* sigset_t *mask, int signo */); 83*0Sstevel@tonic-gate int sigemptyset(/* sigset_t *mask */); 84*0Sstevel@tonic-gate int sigfillset(/* sigset_t *mask */); 85*0Sstevel@tonic-gate int sigismember(/* sigset_t *mask, int signo */); 86*0Sstevel@tonic-gate int sigpending(/* sigset_t *set */); 87*0Sstevel@tonic-gate int sigprocmask(/* int how, sigset_t *set, *oldset */); 88*0Sstevel@tonic-gate int sigsuspend(/* sigset_t *mask */); 89*0Sstevel@tonic-gate 90*0Sstevel@tonic-gate #endif /* _POSIX_SOURCE */ 91*0Sstevel@tonic-gate #endif /* !__signal_h */ 92