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