Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
att
GitHub Repository: att/ast
Path: blob/master/src/cmd/ksh93/data/signals.c
1810 views
1
/***********************************************************************
2
* *
3
* This software is part of the ast package *
4
* Copyright (c) 1982-2012 AT&T Intellectual Property *
5
* and is licensed under the *
6
* Eclipse Public License, Version 1.0 *
7
* by AT&T Intellectual Property *
8
* *
9
* A copy of the License is available at *
10
* http://www.eclipse.org/org/documents/epl-v10.html *
11
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
12
* *
13
* Information and Software Systems Research *
14
* AT&T Research *
15
* Florham Park NJ *
16
* *
17
* David Korn <[email protected]> *
18
* *
19
***********************************************************************/
20
#include "defs.h"
21
22
#if defined(SIGCLD) && !defined(SIGCHLD)
23
# define SIGCHLD SIGCLD
24
#endif
25
26
#define VAL(sig,mode) ((sig+1)|((mode)<<SH_SIGBITS))
27
#define TRAP(n) (((n)|SH_TRAP)-1)
28
29
#ifndef ERROR_dictionary
30
# define ERROR_dictionary(s) (s)
31
#endif
32
#define S(s) ERROR_dictionary(s)
33
34
/*
35
* This is a table that gives numbers and default settings to each signal.
36
* The signal numbers go in the low bits and the attributes go in the high bits.
37
* The names must be ASCII sorted lo-hi.
38
*/
39
40
const struct shtable2 shtab_signals[] =
41
{
42
#ifdef SIGABRT
43
"ABRT", VAL(SIGABRT,SH_SIGDONE), S("Abort"),
44
#endif /*SIGABRT */
45
#ifdef SIGAIO
46
"AIO", VAL(SIGAIO,SH_SIGIGNORE), S("Asynchronous I/O"),
47
#endif /*SIGAIO */
48
#ifdef SIGALRM
49
"ALRM", VAL(SIGALRM,SH_SIGDONE), S("Alarm call"),
50
#endif /* SIGALRM */
51
#ifdef SIGALRM1
52
"ALRM1", VAL(SIGALRM1,SH_SIGDONE), S("Scheduling - reserved"),
53
#endif /* SIGALRM */
54
#ifdef SIGAPOLLO
55
"APOLLO", VAL(SIGAPOLLO,0), S("SIGAPOLLO"),
56
#endif /* SIGAPOLLO */
57
#ifdef SIGBUS
58
"BUS", VAL(SIGBUS,SH_SIGDONE), S("Bus error"),
59
#endif /* SIGBUS */
60
#ifdef SIGCANCEL
61
"CANCEL", VAL(SIGCANCEL,SH_SIGIGNORE), S("Thread cancellation"),
62
#endif /*SIGCANCEL */
63
#ifdef SIGCHLD
64
"CHLD", VAL(SIGCHLD,SH_SIGFAULT), S("Death of Child"),
65
# ifdef SIGCLD
66
# if SIGCLD!=SIGCHLD
67
"CLD", VAL(SIGCLD,SH_SIGFAULT), S("Death of Child"),
68
# endif
69
# endif /* SIGCLD */
70
#else
71
# ifdef SIGCLD
72
"CLD", VAL(SIGCLD,SH_SIGFAULT), S("Death of Child"),
73
# endif /* SIGCLD */
74
#endif /* SIGCHLD */
75
#ifdef SIGCONT
76
"CONT", VAL(SIGCONT,SH_SIGIGNORE), S("Stopped process continued"),
77
#endif /* SIGCONT */
78
#ifdef SIGCPUFAIL
79
"CPUFAIL", VAL(SIGCPUFAIL,0), S("Predictive processor deconfiguration"),
80
#endif /* SIGRETRACT */
81
"DEBUG", VAL(TRAP(SH_DEBUGTRAP),0), "",
82
#ifdef SIGDANGER
83
"DANGER", VAL(SIGDANGER,0), S("System crash soon"),
84
#endif /* SIGDANGER */
85
#ifdef SIGDIL
86
"DIL", VAL(SIGDIL,0), S("DIL signal"),
87
#endif /* SIGDIL */
88
#ifdef SIGEMT
89
"EMT", VAL(SIGEMT,SH_SIGDONE), S("EMT trap"),
90
#endif /* SIGEMT */
91
"ERR", VAL(TRAP(SH_ERRTRAP),0), "",
92
#ifdef SIGERR
93
"ERR", VAL(SIGERR,0), "",
94
#endif /* SIGERR */
95
"EXIT", VAL(0,0), "",
96
"FPE", VAL(SIGFPE,SH_SIGDONE), S("Floating exception"),
97
#ifdef SIGFREEZE
98
"FREEZE", VAL(SIGFREEZE,SH_SIGIGNORE), S("Special signal used by CPR"),
99
#endif /* SIGFREEZE */
100
#ifdef SIGGRANT
101
"GRANT", VAL(SIGGRANT,0), S("Grant monitor mode"),
102
#endif /* SIGGRANT */
103
"HUP", VAL(SIGHUP,SH_SIGDONE), S("Hangup"),
104
"ILL", VAL(SIGILL,SH_SIGDONE), S("Illegal instruction"),
105
#ifdef JOBS
106
"INT", VAL(SIGINT,SH_SIGINTERACTIVE), S("Interrupt"),
107
#else
108
"INT", VAL(SIGINT,SH_SIGINTERACTIVE), "",
109
#endif /* JOBS */
110
#ifdef SIGIO
111
"IO", VAL(SIGIO,SH_SIGDONE), S("IO signal"),
112
#endif /* SIGIO */
113
#ifdef SIGIOT
114
"IOT", VAL(SIGIOT,SH_SIGDONE), S("Abort"),
115
#endif /* SIGIOT */
116
#ifdef SIGJVM1
117
"JVM1", VAL(SIGJVM1,SH_SIGIGNORE), S("Special signal used by Java Virtual Machine"),
118
#endif /*SIGJVM1 */
119
#ifdef SIGJVM2
120
"JVM2", VAL(SIGJVM2,SH_SIGIGNORE), S("Special signal used by Java Virtual Machine"),
121
#endif /*SIGJVM2 */
122
"KEYBD", VAL(TRAP(SH_KEYTRAP),0), "",
123
#ifdef SIGKILL
124
"KILL", VAL(SIGKILL,0), S("Killed"),
125
#endif /* SIGKILL */
126
#ifdef SIGLAB
127
"LAB", VAL(SIGLAB,0), S("Security label changed"),
128
#endif /* SIGLAB */
129
#ifdef SIGLOST
130
"LOST", VAL(SIGLOST,SH_SIGDONE), S("Resources lost"),
131
#endif /* SIGLOST */
132
#ifdef SIGLWP
133
"LWP", VAL(SIGLWP,SH_SIGIGNORE), S("Special signal used by thread library"),
134
#endif /* SIGLWP */
135
#ifdef SIGMIGRATE
136
"MIGRATE", VAL(SIGMIGRATE,0), S("Migrate process"),
137
#endif /* SIGMIGRATE */
138
#ifdef SIGMSG
139
"MSG", VAL(SIGMSG,0), S("Ring buffer input data"),
140
#endif /* SIGMSG */
141
#ifdef SIGPHONE
142
"PHONE", VAL(SIGPHONE,0), S("Phone interrupt"),
143
#endif /* SIGPHONE */
144
#ifdef SIGPIPE
145
#ifdef JOBS
146
"PIPE", VAL(SIGPIPE,SH_SIGDONE), S("Broken Pipe"),
147
#else
148
"PIPE", VAL(SIGPIPE,SH_SIGDONE), "",
149
#endif /* JOBS */
150
#endif /* SIGPIPE */
151
#ifdef SIGPOLL
152
"POLL", VAL(SIGPOLL,SH_SIGDONE), S("Polling alarm"),
153
#endif /* SIGPOLL */
154
#ifdef SIGPROF
155
"PROF", VAL(SIGPROF,SH_SIGDONE), S("Profiling time alarm"),
156
#endif /* SIGPROF */
157
#ifdef SIGPRE
158
"PRE", VAL(SIGPRE,SH_SIGDONE), S("Programming exception"),
159
#endif /* SIGPRE */
160
#ifdef SIGPWR
161
# if SIGPWR>0
162
"PWR", VAL(SIGPWR,SH_SIGIGNORE), S("Power fail"),
163
# endif
164
#endif /* SIGPWR */
165
#ifdef SIGQUIT
166
"QUIT", VAL(SIGQUIT,SH_SIGDONE|SH_SIGINTERACTIVE), S("Quit"),
167
#endif /* SIGQUIT */
168
#ifdef SIGRETRACT
169
"RETRACT", VAL(SIGRETRACT,0), S("Relinquish monitor mode"),
170
#endif /* SIGRETRACT */
171
#ifdef SIGRTMIN
172
"RTMIN", VAL(SH_SIGRTMIN,SH_SIGRUNTIME), S("Lowest priority realtime signal"),
173
#endif /* SIGRTMIN */
174
#ifdef SIGRTMAX
175
"RTMAX", VAL(SH_SIGRTMAX,SH_SIGRUNTIME), S("Highest priority realtime signal"),
176
#endif /* SIGRTMAX */
177
#ifdef SIGSAK
178
"SAK", VAL(SIGSAK,0), S("Secure attention key"),
179
#endif /* SIGSAK */
180
"SEGV", VAL(SIGSEGV,0), S("Memory fault"),
181
#ifdef SIGSOUND
182
"SOUND", VAL(SIGSOUND,0), S("Sound completed"),
183
#endif /* SIGSOUND */
184
#ifdef SIGSTOP
185
"STOP", VAL(SIGSTOP,0), S("Stopped (SIGSTOP)"),
186
#endif /* SIGSTOP */
187
#ifdef SIGSYS
188
"SYS", VAL(SIGSYS,SH_SIGDONE), S("Bad system call"),
189
#endif /* SIGSYS */
190
#ifdef SIGSTKFLT
191
"STKFLT", VAL(SIGSTKFLT,SH_SIGDONE), S("Stack Fault"),
192
#endif /* SIGSTKFLT */
193
"TERM", VAL(SIGTERM,SH_SIGDONE|SH_SIGINTERACTIVE), S("Terminated"),
194
#ifdef SIGTHAW
195
"THAW", VAL(SIGTHAW,SH_SIGIGNORE), S("Special signal used by CPR"),
196
#endif /* SIGTHAW */
197
#ifdef SIGTINT
198
# ifdef JOBS
199
"TINT", VAL(SIGTINT,0), S("Interrupt"),
200
# else
201
"TINT", VAL(SIGTINT,0), "",
202
# endif /* JOBS */
203
#endif /* SIGTINT */
204
#ifdef SIGTRAP
205
"TRAP", VAL(SIGTRAP,SH_SIGDONE), S("Trace/BPT trap"),
206
#endif /* SIGTRAP */
207
#ifdef SIGTSTP
208
"TSTP", VAL(SIGTSTP,0), S("Stopped"),
209
#endif /* SIGTSTP */
210
#ifdef SIGTTIN
211
"TTIN", VAL(SIGTTIN,0), S("Stopped (SIGTTIN)"),
212
#endif /* SIGTTIN */
213
#ifdef SIGTTOU
214
"TTOU", VAL(SIGTTOU,0), S("Stopped (SIGTTOU)"),
215
#endif /* SIGTTOU */
216
#ifdef SIGURG
217
"URG", VAL(SIGURG,SH_SIGIGNORE), S("Socket interrupt"),
218
#endif /* SIGURG */
219
#ifdef SIGUSR1
220
"USR1", VAL(SIGUSR1,SH_SIGDONE), S("User signal 1"),
221
#endif /* SIGUSR1 */
222
#ifdef SIGUSR2
223
"USR2", VAL(SIGUSR2,SH_SIGDONE), S("User signal 2"),
224
#endif /* SIGUSR2 */
225
#ifdef SIGVIRT
226
"VIRT", VAL(SIGVIRT,0), S("Virtual timer alarm"),
227
#endif /* SIGVIRT */
228
#ifdef SIGVTALRM
229
"VTALRM", VAL(SIGVTALRM,SH_SIGDONE), S("Virtual time alarm"),
230
#endif /* SIGVTALRM */
231
#ifdef SIGWAITING
232
"WAITING", VAL(SIGWAITING,SH_SIGIGNORE), S("All threads blocked"),
233
#endif /* SIGWAITING */
234
#ifdef SIGWINCH
235
"WINCH", VAL(SIGWINCH,SH_SIGIGNORE), S("Window size change"),
236
#endif /* SIGWINCH */
237
#ifdef SIGXCPU
238
"XCPU", VAL(SIGXCPU,SH_SIGDONE|SH_SIGINTERACTIVE), S("Exceeded CPU time limit"),
239
#endif /* SIGXCPU */
240
#ifdef SIGXFSZ
241
"XFSZ", VAL(SIGXFSZ,SH_SIGDONE|SH_SIGINTERACTIVE), S("Exceeded file size limit"),
242
#endif /* SIGXFSZ */
243
#ifdef SIGXRES
244
"XRES", VAL(SIGXRES,SH_SIGDONE|SH_SIGINTERACTIVE), S("Exceeded resource control"),
245
#endif /* SIGRES */
246
"", 0, 0
247
};
248
249