|
|
1.1 root 1: /*
2: * Copyright (c) 1982, 1986 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: *
6: * @(#)signal.h 7.3 (Berkeley) 5/14/88
7: */
8:
9: #ifndef NSIG
10: #define NSIG 32
11:
12: #ifdef KERNEL
13: #include "../machine/trap.h" /* codes for SIGILL, SIGFPE */
14: #else
15: #include <machine/trap.h> /* codes for SIGILL, SIGFPE */
16: #endif
17:
18: #define SIGHUP 1 /* hangup */
19: #define SIGINT 2 /* interrupt */
20: #define SIGQUIT 3 /* quit */
21: #define SIGILL 4 /* illegal instruction (not reset when caught) */
22: #define SIGTRAP 5 /* trace trap (not reset when caught) */
23: #define SIGIOT 6 /* IOT instruction */
24: #define SIGABRT SIGIOT /* compatibility */
25: #define SIGEMT 7 /* EMT instruction */
26: #define SIGFPE 8 /* floating point exception */
27: #define SIGKILL 9 /* kill (cannot be caught or ignored) */
28: #define SIGBUS 10 /* bus error */
29: #define SIGSEGV 11 /* segmentation violation */
30: #define SIGSYS 12 /* bad argument to system call */
31: #define SIGPIPE 13 /* write on a pipe with no one to read it */
32: #define SIGALRM 14 /* alarm clock */
33: #define SIGTERM 15 /* software termination signal from kill */
34: #define SIGURG 16 /* urgent condition on IO channel */
35: #define SIGSTOP 17 /* sendable stop signal not from tty */
36: #define SIGTSTP 18 /* stop signal from tty */
37: #define SIGCONT 19 /* continue a stopped process */
38: #define SIGCHLD 20 /* to parent on child stop or exit */
39: #define SIGCLD SIGCHLD /* compatibility */
40: #define SIGTTIN 21 /* to readers pgrp upon background tty read */
41: #define SIGTTOU 22 /* like TTIN for output if (tp->t_local<OSTOP) */
42: #define SIGIO 23 /* input/output possible signal */
43: #define SIGXCPU 24 /* exceeded CPU time limit */
44: #define SIGXFSZ 25 /* exceeded file size limit */
45: #define SIGVTALRM 26 /* virtual time alarm */
46: #define SIGPROF 27 /* profiling time alarm */
47: #define SIGWINCH 28 /* window size changes */
48: #define SIGUSR1 30 /* user defined signal 1 */
49: #define SIGUSR2 31 /* user defined signal 2 */
50:
51: #ifndef KERNEL
52: int (*signal())();
53: #endif
54:
55: /*
56: * Signal vector "template" used in sigvec call.
57: */
58: struct sigvec {
59: int (*sv_handler)(); /* signal handler */
60: int sv_mask; /* signal mask to apply */
61: int sv_flags; /* see signal options below */
62: };
63: #define SV_ONSTACK 0x0001 /* take signal on signal stack */
64: #define SV_INTERRUPT 0x0002 /* do not restart system on signal return */
65: #define sv_onstack sv_flags /* isn't compatibility wonderful! */
66:
67: /*
68: * Structure used in sigstack call.
69: */
70: struct sigstack {
71: char *ss_sp; /* signal stack pointer */
72: int ss_onstack; /* current status */
73: };
74:
75: /*
76: * Information pushed on stack when a signal is delivered.
77: * This is used by the kernel to restore state following
78: * execution of the signal handler. It is also made available
79: * to the handler to allow it to properly restore state if
80: * a non-standard exit is performed.
81: */
82: struct sigcontext {
83: int sc_onstack; /* sigstack state to restore */
84: int sc_mask; /* signal mask to restore */
85: int sc_sp; /* sp to restore */
86: int sc_fp; /* fp to restore */
87: int sc_ap; /* ap to restore */
88: int sc_pc; /* pc to restore */
89: int sc_ps; /* psl to restore */
90: };
91:
92: #define BADSIG (int (*)())-1
93: #define SIG_DFL (int (*)())0
94: #define SIG_IGN (int (*)())1
95:
96: #ifdef KERNEL
97: #define SIG_CATCH (int (*)())2
98: #define SIG_HOLD (int (*)())3
99: #endif
100: #endif
101:
102: /*
103: * Macro for converting signal number to a mask suitable for
104: * sigblock().
105: */
106: #define sigmask(m) (1 << ((m)-1))
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.