]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/tcsh/sh.init.c
This commit was generated by cvs2svn to compensate for changes in r95419,
[FreeBSD/FreeBSD.git] / contrib / tcsh / sh.init.c
1 /* $Header: /src/pub/tcsh/sh.init.c,v 3.48 1999/02/11 16:18:36 christos Exp $ */
2 /*
3  * sh.init.c: Function and signal tables
4  */
5 /*-
6  * Copyright (c) 1980, 1991 The Regents of the University of California.
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  * 3. All advertising materials mentioning features or use of this software
18  *    must display the following acknowledgement:
19  *      This product includes software developed by the University of
20  *      California, Berkeley and its contributors.
21  * 4. Neither the name of the University nor the names of its contributors
22  *    may be used to endorse or promote products derived from this software
23  *    without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35  * SUCH DAMAGE.
36  */
37 #include "sh.h"
38
39 RCSID("$Id: sh.init.c,v 3.48 1999/02/11 16:18:36 christos Exp $")
40
41 #include "ed.h"
42 #include "tw.h"
43
44 /*
45  * C shell
46  */
47
48 #define INF     0x7fffffff
49
50 struct  biltins bfunc[] = {
51     { ":",              dozip,          0,      INF     },
52     { "@",              dolet,          0,      INF     },
53     { "alias",          doalias,        0,      INF     },
54 #ifdef OBSOLETE
55     { "aliases",        doaliases,      0,      1,      },
56 #endif /* OBSOLETE */
57     { "alloc",          showall,        0,      1       },
58 #if defined(_CX_UX)
59     { "att",            doatt,          0,      INF     },
60 #endif /* _CX_UX */
61     { "bg",             dobg,           0,      INF     },
62 #ifdef OBSOLETE
63     { "bind",           dobind,         0,      2       },
64 #endif /* OBSOLETE */
65     { "bindkey",        dobindkey,      0,      8       },
66     { "break",          dobreak,        0,      0       },
67     { "breaksw",        doswbrk,        0,      0       },
68     { "builtins",       dobuiltins,     0,      0       },
69 #ifdef KAI
70     { "bye",            goodbye,        0,      0       },
71 #endif /* KAI */
72     { "case",           dozip,          0,      1       },
73     { "cd",             dochngd,        0,      INF     },
74     { "chdir",          dochngd,        0,      INF     },
75     { "complete",       docomplete,     0,      INF     },
76     { "continue",       docontin,       0,      0       },
77     { "default",        dozip,          0,      0       },
78     { "dirs",           dodirs,         0,      INF     },
79 #if defined(_CRAY) && !defined(_CRAYMPP)
80     { "dmmode",         dodmmode,       0,      1       },
81 #endif /* _CRAY && !_CRAYMPP */
82     { "echo",           doecho,         0,      INF     },
83     { "echotc",         doechotc,       0,      INF     },
84     { "else",           doelse,         0,      INF     },
85     { "end",            doend,          0,      0       },
86     { "endif",          dozip,          0,      0       },
87     { "endsw",          dozip,          0,      0       },
88     { "eval",           doeval,         0,      INF     },
89     { "exec",           execash,        1,      INF     },
90     { "exit",           doexit,         0,      INF     },
91     { "fg",             dofg,           0,      INF     },
92     { "filetest",       dofiletest,     2,      INF     },
93     { "foreach",        doforeach,      3,      INF     },
94 #ifdef TCF
95     { "getspath",       dogetspath,     0,      0       },
96     { "getxvers",       dogetxvers,     0,      0       },
97 #endif /* TCF */
98     { "glob",           doglob,         0,      INF     },
99     { "goto",           dogoto,         1,      1       },
100     { "hashstat",       hashstat,       0,      0       },
101     { "history",        dohist,         0,      2       },
102     { "hup",            dohup,          0,      INF     },
103     { "if",             doif,           1,      INF     },
104 #ifdef apollo
105     { "inlib",          doinlib,        1,      INF     },
106 #endif /* apollo */
107     { "jobs",           dojobs,         0,      1       },
108     { "kill",           dokill,         1,      INF     },
109 #ifndef HAVENOLIMIT
110     { "limit",          dolimit,        0,      3       },
111 #endif /* !HAVENOLIMIT */
112 #ifdef OBSOLETE
113     { "linedit",        doecho,         0,      INF     },
114 #endif /* OBSOLETE */
115 #if !defined(HAVENOUTMP) && !defined(KAI)
116     { "log",            dolog,          0,      0       },
117 #endif /* !HAVENOUTMP && !KAI */
118     { "login",          dologin,        0,      1       },
119     { "logout",         dologout,       0,      0       },
120     { "ls-F",           dolist,         0,      INF     },
121 #ifdef TCF
122     { "migrate",        domigrate,      1,      INF     },
123 #endif /* TCF */
124 #ifdef NEWGRP
125     { "newgrp",         donewgrp,       1,      2       },
126 #endif /* NEWGRP */
127     { "nice",           donice,         0,      INF     },
128     { "nohup",          donohup,        0,      INF     },
129     { "notify",         donotify,       0,      INF     },
130     { "onintr",         doonintr,       0,      2       },
131     { "popd",           dopopd,         0,      INF     },
132     { "printenv",       doprintenv,     0,      1       },
133     { "pushd",          dopushd,        0,      INF     },
134     { "rehash",         dohash,         0,      3       },
135     { "repeat",         dorepeat,       2,      INF     },
136 #ifdef apollo
137     { "rootnode",       dorootnode,     1,      1       },
138 #endif /* apollo */
139     { "sched",          dosched,        0,      INF     },
140     { "set",            doset,          0,      INF     },
141     { "setenv",         dosetenv,       0,      2       },
142 #ifdef MACH
143     { "setpath",        dosetpath,      0,      INF     },
144 #endif  /* MACH */
145 #ifdef TCF
146     { "setspath",       dosetspath,     1,      INF     },
147 #endif /* TCF */
148     { "settc",          dosettc,        2,      2       },
149     { "setty",          dosetty,        0,      INF     },
150 #ifdef TCF
151     { "setxvers",       dosetxvers,     0,      1       },
152 #endif /* TCF */
153     { "shift",          shift,          0,      1       },
154     { "source",         dosource,       1,      INF     },
155     { "stop",           dostop,         1,      INF     },
156     { "suspend",        dosuspend,      0,      0       },
157     { "switch",         doswitch,       1,      INF     },
158     { "telltc",         dotelltc,       0,      INF     },
159     { "time",           dotime,         0,      INF     },
160 #if defined(_CX_UX)
161     { "ucb",            doucb,          0,      INF     },
162 #endif /* _CX_UX */
163     { "umask",          doumask,        0,      1       },
164     { "unalias",        unalias,        1,      INF     },
165     { "uncomplete",     douncomplete,   1,      INF     },
166     { "unhash",         dounhash,       0,      0       },
167 #if defined(masscomp) || defined(_CX_UX)
168     { "universe",       douniverse,     0,      INF     },
169 #endif /* masscomp || _CX_UX */
170 #ifndef HAVENOLIMIT
171     { "unlimit",        dounlimit,      0,      INF     },
172 #endif /* !HAVENOLIMIT */
173     { "unset",          unset,          1,      INF     },
174     { "unsetenv",       dounsetenv,     1,      INF     },
175 #ifdef apollo
176     { "ver",            dover,          0,      INF     },
177 #endif /* apollo */
178     { "wait",           dowait,         0,      0       },
179 #ifdef WARP
180     { "warp",           dowarp,         0,      2       },
181 #endif /* WARP */
182 #if !defined(HAVENOUTMP) && defined(KAI)
183     { "watchlog",       dolog,          0,      0       },
184 #endif /* !HAVENOUTMP && KAI */
185     { "where",          dowhere,        1,      INF     },
186     { "which",          dowhich,        1,      INF     },
187     { "while",          dowhile,        1,      INF     }
188 };
189 int nbfunc = sizeof bfunc / sizeof *bfunc;
190
191 struct srch srchn[] = {
192     { "@",              TC_LET          },
193     { "break",          TC_BREAK        },
194     { "breaksw",        TC_BRKSW        },
195     { "case",           TC_CASE         },
196     { "default",        TC_DEFAULT      },
197     { "else",           TC_ELSE         },
198     { "end",            TC_END          },
199     { "endif",          TC_ENDIF        },
200     { "endsw",          TC_ENDSW        },
201     { "exit",           TC_EXIT         },
202     { "foreach",        TC_FOREACH      },
203     { "goto",           TC_GOTO         },
204     { "if",             TC_IF           },
205     { "label",          TC_LABEL        },
206     { "set",            TC_SET          },
207     { "switch",         TC_SWITCH       },
208     { "while",          TC_WHILE        }
209 };
210 int nsrchn = sizeof srchn / sizeof *srchn;
211
212
213 /*
214  * Note: For some machines, (hpux eg.)
215  * NSIG = number of signals + 1...
216  * so we define 33 or 65 (POSIX) signals for 
217  * everybody
218  */
219
220 /* We define NUMSIG to avoid changing NSIG or MAXSIG */
221 #ifdef POSIX
222 # define NUMSIG 65
223 #else /* !POSIX */
224 # define NUMSIG 33
225 #endif /* POSIX */
226
227 int     nsig = NUMSIG - 1;      /* This should be the number of real signals */
228                                 /* not counting signal 0 */
229 struct  mesg mesg[NUMSIG];      /* Arrays start at [0] so we initialize from */
230                                 /* 0 to 32 or 64, the max real signal number */
231
232 void
233 mesginit()
234 {
235
236 #ifdef NLS_CATALOGS
237     int i;
238
239     for (i = 0; i < NUMSIG; i++) {
240         xfree((ptr_t) mesg[i].pname);
241         mesg[i].pname = NULL;
242     }
243 #endif /* NLS_CATALOGS */
244
245 #if defined(SIGNULL) || defined(DECOSF1)
246 # ifndef SIGNULL
247 #  define SIGNULL 0
248 # endif /* !SIGNULL */
249     if (mesg[SIGNULL].pname == NULL) {
250         mesg[SIGNULL].iname = "NULL";
251         mesg[SIGNULL].pname = CSAVS(2, 1, "Null signal");
252     }
253 #endif /* SIGNULL || DECOSF1 */
254
255 #ifdef SIGHUP
256     if (mesg[SIGHUP].pname == NULL) {
257         mesg[SIGHUP].iname = "HUP"; 
258         mesg[SIGHUP].pname = CSAVS(2, 2, "Hangup");
259     }
260 #endif /* SIGHUP */
261
262 #ifdef SIGINT
263     if (mesg[SIGINT].pname == NULL) {
264         mesg[SIGINT].iname = "INT";
265         mesg[SIGINT].pname = CSAVS(2, 3, "Interrupt");
266     }
267 #endif /* SIGINT */
268
269 #ifdef SIGQUIT
270     if (mesg[SIGQUIT].pname == NULL) {
271         mesg[SIGQUIT].iname = "QUIT";
272         mesg[SIGQUIT].pname = CSAVS(2, 4, "Quit");
273     }
274 #endif /* SIGQUIT */
275
276 #ifdef SIGILL
277     if (mesg[SIGILL].pname == NULL) {
278         mesg[SIGILL].iname = "ILL";
279         mesg[SIGILL].pname = CSAVS(2, 5, "Illegal instruction");
280     }
281 #endif /* SIGILL */
282
283 #ifdef SIGTRAP
284     if (mesg[SIGTRAP].pname == NULL) {
285         mesg[SIGTRAP].iname = "TRAP";
286         mesg[SIGTRAP].pname = CSAVS(2, 6, "Trace/BPT trap");
287     }
288 #endif /* SIGTRAP */
289
290 #ifdef SIGABRT
291     if (mesg[SIGABRT].pname == NULL) {
292         mesg[SIGABRT].iname = "ABRT";
293         mesg[SIGABRT].pname = CSAVS(2, 7, "Abort");
294     }
295 #endif /* SIGABRT */
296
297 #ifdef SIGIOT
298     if (mesg[SIGIOT].pname == NULL) {
299         mesg[SIGIOT].iname = "IOT";
300         mesg[SIGIOT].pname = CSAVS(2, 8, "IOT trap");
301     }
302 #endif /* SIGIOT */
303
304 #ifdef SIGDANGER
305     /* aiws */
306     if (mesg[SIGDANGER].pname == NULL) {
307         mesg[SIGDANGER].iname = "DANGER";
308         mesg[SIGDANGER].pname = CSAVS(2, 9, "System Crash Imminent");
309     }
310 #endif /* SIGDANGER */
311
312 #ifdef SIGERR
313     /* _CRAY */
314     if (mesg[SIGERR].pname == NULL) {
315         mesg[SIGERR].iname = "ERR";
316         mesg[SIGERR].pname = CSAVS(2, 10, "Error exit");
317     }
318 #endif /* SIGERR */
319
320 #ifdef SIGEMT
321     if (mesg[SIGEMT].pname == NULL) {
322         mesg[SIGEMT].iname = "EMT";
323         mesg[SIGEMT].pname = CSAVS(2, 11, "EMT trap");
324     }
325 #endif /* SIGEMT */
326
327 #ifdef SIGFPE
328     if (mesg[SIGFPE].pname == NULL) {
329         mesg[SIGFPE].iname = "FPE";
330         mesg[SIGFPE].pname = CSAVS(2, 12, "Floating exception");
331     }
332 #endif /* SIGFPE */
333
334 #ifdef SIGKILL
335     if (mesg[SIGKILL].pname == NULL) {
336         mesg[SIGKILL].iname = "KILL";
337         mesg[SIGKILL].pname = CSAVS(2, 13, "Killed");
338     }
339 #endif /* SIGKILL */
340
341 #ifdef SIGUSR1
342     if (mesg[SIGUSR1].pname == NULL) {
343         mesg[SIGUSR1].iname = "USR1";
344         mesg[SIGUSR1].pname = CSAVS(2, 14, "User signal 1");
345     }
346 #endif /* SIGUSR1 */
347
348 #ifdef SIGUSR2
349     if (mesg[SIGUSR2].pname == NULL) {
350         mesg[SIGUSR2].iname = "USR2";
351         mesg[SIGUSR2].pname = CSAVS(2, 15, "User signal 2");
352     }
353 #endif /* SIGUSR2 */
354
355 #ifdef SIGSEGV
356     if (mesg[SIGSEGV].pname == NULL) {
357         mesg[SIGSEGV].iname = "SEGV";
358         mesg[SIGSEGV].pname = CSAVS(2, 16, "Segmentation fault");
359     }
360 #endif /* SIGSEGV */
361
362 #ifdef SIGBUS
363     if (mesg[SIGBUS].pname == NULL) {
364         mesg[SIGBUS].iname = "BUS";
365         mesg[SIGBUS].pname = CSAVS(2, 17, "Bus error");
366     }
367 #endif /* SIGBUS */
368
369 #ifdef SIGPRE
370     /* _CRAY || IBMAIX */
371     if (mesg[SIGPRE].pname == NULL) {
372         mesg[SIGPRE].iname = "PRE";
373         mesg[SIGPRE].pname = CSAVS(2, 18, "Program range error");
374     }
375 #endif /* SIGPRE */
376
377 #ifdef SIGORE
378     /* _CRAY */
379     if (mesg[SIGORE].pname == NULL) {
380         mesg[SIGORE].iname = "ORE";
381         mesg[SIGORE].pname = CSAVS(2, 19, "Operand range error");
382     }
383 #endif /* SIGORE */
384
385 #ifdef SIGSYS
386     if (mesg[SIGSYS].pname == NULL) {
387         mesg[SIGSYS].iname = "SYS";
388         mesg[SIGSYS].pname = CSAVS(2, 20, "Bad system call");
389     }
390 #endif /* SIGSYS */
391
392 #ifdef SIGPIPE
393     if (mesg[SIGPIPE].pname == NULL) {
394         mesg[SIGPIPE].iname = "PIPE";
395         mesg[SIGPIPE].pname = CSAVS(2, 21, "Broken pipe");
396     }
397 #endif /* SIGPIPE */
398
399 #ifdef SIGALRM
400     if (mesg[SIGALRM].pname == NULL) {
401         mesg[SIGALRM].iname = "ALRM";
402         mesg[SIGALRM].pname = CSAVS(2, 22, "Alarm clock");
403     }
404 #endif /* SIGALRM */
405
406 #ifdef SIGTERM
407     if (mesg[SIGTERM].pname == NULL) {
408         mesg[SIGTERM].iname = "TERM";
409         mesg[SIGTERM].pname = CSAVS(2, 23, "Terminated");
410     }
411 #endif /* SIGTERM */
412
413 /* SIGCLD vs SIGCHLD */
414 #if !defined(SIGCHLD) || defined(SOLARIS2) || defined(apollo) || defined(__EMX__)
415     /* If we don't define SIGCHLD, or our OS prefers SIGCLD to SIGCHLD, */
416     /* check for SIGCLD */
417 # ifdef SIGCLD
418     if (mesg[SIGCLD].pname == NULL) {
419         mesg[SIGCLD].iname = "CLD";
420 #  ifdef BSDJOBS
421         mesg[SIGCLD].pname = CSAVS(2, 24, "Child status change");
422 #  else /* !BSDJOBS */
423         mesg[SIGCLD].pname = CSAVS(2, 25, "Death of child");
424 #  endif /* BSDJOBS */
425     }
426 # endif /* SIGCLD */
427 #else /* !(!SIGCHLD || SOLARIS2 || apollo || __EMX__) */
428     /* We probably define SIGCHLD */
429 # ifdef SIGCHLD
430     if (mesg[SIGCHLD].pname == NULL) {
431         mesg[SIGCHLD].iname = "CHLD";
432 #  ifdef BSDJOBS
433         mesg[SIGCHLD].pname = CSAVS(2, 27, "Child stopped or exited");
434 #  else /* !BSDJOBS */
435         mesg[SIGCHLD].pname = CSAVS(2, 28, "Child exited");
436 #  endif /* BSDJOBS */
437     }
438 # endif /* SIGCHLD */
439 #endif /* !SIGCHLD || SOLARIS2 || apollo || __EMX__ */
440
441 #ifdef SIGAPOLLO
442     /* apollo */
443     if (mesg[SIGAPOLLO].pname == NULL) {
444         mesg[SIGAPOLLO].iname = "APOLLO";
445         mesg[SIGAPOLLO].pname = CSAVS(2, 26, "Apollo-specific fault");
446     }
447 #endif /* SIGAPOLLO */
448
449 #ifdef SIGPWR
450     if (mesg[SIGPWR].pname == NULL) {
451         mesg[SIGPWR].iname = "PWR";
452         mesg[SIGPWR].pname = CSAVS(2, 29, "Power failure");
453     }
454 #endif /* SIGPWR */
455
456 #ifdef SIGLOST
457     if (mesg[SIGLOST].pname == NULL) {
458         mesg[SIGLOST].iname = "LOST";
459         mesg[SIGLOST].pname = CSAVS(2, 30, "Resource Lost");
460     }
461 #endif /* SIGLOST */
462
463 #ifdef SIGBREAK
464     /* __EMX__ */
465     if (mesg[SIGBREAK].pname == NULL) {
466         mesg[SIGBREAK].iname = "BREAK";
467         mesg[SIGBREAK].pname = CSAVS(2, 31, "Break (Ctrl-Break)");
468     }
469 #endif /* SIGBREAK */
470
471 #ifdef SIGIO
472 # if !defined(SIGPOLL) || SIGPOLL != SIGIO
473     if (mesg[SIGIO].pname == NULL) {
474         mesg[SIGIO].iname = "IO";
475 #  ifdef cray
476         mesg[SIGIO].pname = CSAVS(2, 32, "Input/output possible signal");
477 #  else /* !cray */
478         mesg[SIGIO].pname = CSAVS(2, 33, "Asynchronous I/O (select)");
479 #  endif /* cray */
480     }
481 # endif /* !SIGPOLL || SIGPOLL != SIGIO */
482 #endif /* SIGIO */
483
484 #ifdef SIGURG
485     if (mesg[SIGURG].pname == NULL) {
486         mesg[SIGURG].iname = "URG";
487         mesg[SIGURG].pname = CSAVS(2, 34, "Urgent condition on I/O channel");
488     }
489 #endif /* SIGURG */
490
491 #ifdef SIGMT
492     /* cray */
493     if (mesg[SIGMT].pname == NULL) {
494         mesg[SIGMT].iname = "MT";
495         mesg[SIGMT].pname = CSAVS(2, 35, "Multitasking wake-up");
496     }
497 #endif /* SIGMT */
498
499 #ifdef SIGMTKILL
500     /* cray */
501     if (mesg[SIGMTKILL].pname == NULL) {
502         mesg[SIGMTKILL].iname = "MTKILL";
503         mesg[SIGMTKILL].pname = CSAVS(2, 36, "Multitasking kill");
504     }
505 #endif /* SIGMTKILL */
506
507 #ifdef SIGBUFIO
508     /* _CRAYCOM */
509     if (mesg[SIGBUFIO].pname == NULL) {
510         mesg[SIGBUFIO].iname = "BUFIO";
511         mesg[SIGBUFIO].pname = CSAVS(2, 37,
512                                     "Fortran asynchronous I/O completion");
513     }
514 #endif /* SIGBUFIO */
515
516 #ifdef SIGRECOVERY
517     /* _CRAYCOM */
518     if (mesg[SIGRECOVERY].pname == NULL) {
519         mesg[SIGRECOVERY].iname = "RECOVERY";
520         mesg[SIGRECOVERY].pname = CSAVS(2, 38, "Recovery");
521     }
522 #endif /* SIGRECOVERY */
523
524 #ifdef SIGUME
525     /* _CRAYCOM */
526     if (mesg[SIGUME].pname == NULL) {
527         mesg[SIGUME].iname = "UME";
528         mesg[SIGUME].pname = CSAVS(2, 39, "Uncorrectable memory error");
529     }
530 #endif /* SIGUME */
531
532 #ifdef SIGCPULIM
533     /* _CRAYCOM */
534     if (mesg[SIGCPULIM].pname == NULL) {
535         mesg[SIGCPULIM].iname = "CPULIM";
536         mesg[SIGCPULIM].pname = CSAVS(2, 40, "CPU time limit exceeded");
537     }
538 #endif /* SIGCPULIM */
539
540 #ifdef SIGSHUTDN
541     /* _CRAYCOM */
542     if (mesg[SIGSHUTDN].pname == NULL) {
543         mesg[SIGSHUTDN].iname = "SHUTDN";
544         mesg[SIGSHUTDN].pname = CSAVS(2, 41, "System shutdown imminent");
545     }
546 #endif /* SIGSHUTDN */
547
548 #ifdef SIGNOWAK
549     /* _CRAYCOM */
550     if (mesg[SIGNOWAK].pname == NULL) {
551         mesg[SIGNOWAK].iname = "NOWAK";
552         mesg[SIGNOWAK].pname = CSAVS(2, 42,
553                                     "Micro-tasking group-no wakeup flag set");
554     }
555 #endif /* SIGNOWAK */
556
557 #ifdef SIGTHERR
558     /* _CRAYCOM */
559     if (mesg[SIGTHERR].pname == NULL) {
560         mesg[SIGTHERR].iname = "THERR";
561         mesg[SIGTHERR].pname = CSAVS(2, 43, 
562                             "Thread error - (use cord -T for detailed info)");
563     }
564 #endif /* SIGTHERR */
565
566 #ifdef SIGRPE
567     /* cray */
568     if (mesg[SIGRPE].pname == NULL) {
569         mesg[SIGRPE].pname = CSAVS(2, 44, "CRAY Y-MP register parity error");
570         mesg[SIGRPE].iname = "RPE";
571     }
572 #endif /* SIGRPE */
573
574 #ifdef SIGINFO
575     if (mesg[SIGINFO].pname == NULL) {
576         mesg[SIGINFO].iname = "INFO";
577         mesg[SIGINFO].pname = CSAVS(2, 45, "Information request");
578     }
579 #endif /* SIGINFO */
580
581 #ifdef SIGSTOP
582     if (mesg[SIGSTOP].pname == NULL) {
583         mesg[SIGSTOP].iname = "STOP";
584 # ifdef SUSPENDED
585         mesg[SIGSTOP].pname = CSAVS(2, 46, "Suspended (signal)");
586 # else /* !SUSPENDED */
587         mesg[SIGSTOP].pname = CSAVS(2, 47, "Stopped (signal)");
588 # endif /* SUSPENDED */
589     }
590 #endif /* SIGSTOP */
591
592 #ifdef SIGTSTP
593     if (mesg[SIGTSTP].pname == NULL) {
594         mesg[SIGTSTP].iname = "TSTP";
595 # ifdef SUSPENDED
596         mesg[SIGTSTP].pname = CSAVS(2, 48, "Suspended");
597 # else /* !SUSPENDED */
598         mesg[SIGTSTP].pname = CSAVS(2, 49, "Stopped");
599 # endif /* SUSPENDED */
600     }
601 #endif /* SIGTSTP */
602
603 #ifdef SIGCONT
604     if (mesg[SIGCONT].pname == NULL) {
605         mesg[SIGCONT].iname = "CONT";
606         mesg[SIGCONT].pname = CSAVS(2, 50, "Continued");
607     }
608 #endif /* SIGCONT */
609
610 #ifdef SIGTTIN
611     if (mesg[SIGTTIN].pname == NULL) {
612         mesg[SIGTTIN].iname = "TTIN";
613 # ifdef SUSPENDED
614         mesg[SIGTTIN].pname = CSAVS(2, 51, "Suspended (tty input)");
615 # else /* !SUSPENDED */
616         mesg[SIGTTIN].pname = CSAVS(2, 52, "Stopped (tty input)");
617 # endif /* SUSPENDED */
618     }
619 #endif /* SIGTTIN */
620
621 #ifdef SIGTTOU
622     if (mesg[SIGTTOU].pname == NULL) {
623         mesg[SIGTTOU].iname = "TTOU";
624 # ifdef SUSPENDED
625         mesg[SIGTTOU].pname = CSAVS(2, 53, "Suspended (tty output)");
626 # else /* SUSPENDED */
627         mesg[SIGTTOU].pname = CSAVS(2, 54, "Stopped (tty output)");
628 # endif /* SUSPENDED */
629     }
630 #endif /* SIGTTOU */
631
632 #ifdef SIGWIND
633     /* UNIXPC */
634     if (mesg[SIGWIND].pname == NULL) {
635         mesg[SIGWIND].iname = "WIND";
636         mesg[SIGWIND].pname = CSAVS(2, 55, "Window status changed");
637     }
638 #endif /* SIGWIND */
639
640 #ifdef SIGWINDOW
641     if (mesg[SIGWINDOW].pname == NULL) {
642         mesg[SIGWINDOW].iname = "WINDOW";
643         mesg[SIGWINDOW].pname = CSAVS(2, 56, "Window size changed");
644     }
645 #endif /* SIGWINDOW */
646
647 #ifdef SIGWINCH
648     if (mesg[SIGWINCH].pname == NULL) {
649         mesg[SIGWINCH].iname = "WINCH";
650         mesg[SIGWINCH].pname = CSAVS(2, 56, "Window size changed");
651     }
652 #endif /* SIGWINCH */
653
654 #ifdef SIGPHONE
655     /* UNIXPC */
656     if (mesg[SIGPHONE].pname == NULL) {
657         mesg[SIGPHONE].iname = "PHONE";
658         mesg[SIGPHONE].pname = CSAVS(2, 57, "Phone status changed");
659     }
660 # endif /* SIGPHONE */
661
662 #ifdef SIGXCPU
663     if (mesg[SIGXCPU].pname == NULL) {
664         mesg[SIGXCPU].iname = "XCPU";
665         mesg[SIGXCPU].pname = CSAVS(2, 58, "Cputime limit exceeded");
666     }
667 #endif /* SIGXCPU */
668
669 #ifdef SIGXFSZ
670     if (mesg[SIGXFSZ].pname == NULL) {
671         mesg[SIGXFSZ].iname = "XFSZ";
672         mesg[SIGXFSZ].pname = CSAVS(2, 59, "Filesize limit exceeded");
673     }
674 #endif /* SIGXFSZ */
675
676 #ifdef SIGVTALRM
677     if (mesg[SIGVTALRM].pname == NULL) {
678         mesg[SIGVTALRM].iname = "VTALRM";
679         mesg[SIGVTALRM].pname = CSAVS(2, 60, "Virtual time alarm");
680     }
681 #endif /* SIGVTALRM */
682
683 #ifdef SIGPROF
684     if (mesg[SIGPROF].pname == NULL) {
685         mesg[SIGPROF].iname = "PROF";
686         mesg[SIGPROF].pname = CSAVS(2, 61, "Profiling time alarm");
687     }
688 #endif /* SIGPROF */
689
690 #ifdef SIGDIL
691     /* hpux */
692     if (mesg[SIGDIL].pname == NULL) {
693         mesg[SIGDIL].iname = "DIL";
694         mesg[SIGDIL].pname = CSAVS(2, 62, "DIL signal");
695     }
696 #endif /* SIGDIL */
697
698 #ifdef SIGPOLL
699     if (mesg[SIGPOLL].pname == NULL) {
700         mesg[SIGPOLL].iname = "POLL";
701         mesg[SIGPOLL].pname = CSAVS(2, 63, "Pollable event occured");
702     }
703 #endif /* SIGPOLL */
704
705 #ifdef SIGWAITING
706     /* solaris */
707     if (mesg[SIGWAITING].pname == NULL) {
708         mesg[SIGWAITING].iname = "WAITING";
709         mesg[SIGWAITING].pname = CSAVS(2, 64, "Process's lwps are blocked");
710     }
711 #endif /* SIGWAITING */
712
713 #ifdef SIGLWP
714     /* solaris */
715     if (mesg[SIGLWP].pname == NULL) {
716         mesg[SIGLWP].iname = "LWP";
717         mesg[SIGLWP].pname = CSAVS(2, 65, "Special LWP signal");
718     }
719 #endif /* SIGLWP */
720
721 #ifdef SIGFREEZE
722     /* solaris */
723     if (mesg[SIGFREEZE].pname == NULL) {
724         mesg[SIGFREEZE].iname = "FREEZE";
725         mesg[SIGFREEZE].pname = CSAVS(2, 66, "Special CPR Signal");
726     }
727 #endif /* SIGFREEZE */
728
729 #ifdef SIGTHAW
730     /* solaris */
731     if (mesg[SIGTHAW].pname == NULL) {
732         mesg[SIGTHAW].iname = "THAW";
733         mesg[SIGTHAW].pname = CSAVS(2, 67, "Special CPR Signal");
734     }
735 #endif /* SIGTHAW */
736
737 #ifdef SIGCANCEL
738     /* solaris */
739     if (mesg[SIGCANCEL].pname == NULL) {
740         mesg[SIGCANCEL].iname = "CANCEL";
741         mesg[SIGCANCEL].pname = CSAVS(2, 109, 
742             "Thread cancellation signal used by libthread");
743     }
744 #endif /* SIGCANCEL */
745
746 /*
747  * Careful, some OS's (HP/UX 10.0) define these as -1
748  */
749 #ifdef SIGRTMIN 
750     /*
751      * Cannot do this at compile time; Solaris2 uses _sysconf for these
752      */
753     if (SIGRTMIN > 0 && SIGRTMIN < NUMSIG) { 
754         if (mesg[SIGRTMIN].pname == NULL) {
755             mesg[SIGRTMIN].iname = "RTMIN";
756             mesg[SIGRTMIN].pname = CSAVS(2, 68, "First Realtime Signal");
757         }
758
759         if (mesg[SIGRTMIN+1].pname == NULL) {
760             mesg[SIGRTMIN+1].iname = "RTMIN+1";
761             mesg[SIGRTMIN+1].pname = CSAVS(2, 69, "Second Realtime Signal");
762         }
763
764         if (mesg[SIGRTMIN+2].pname == NULL) {
765             mesg[SIGRTMIN+2].iname = "RTMIN+2";
766             mesg[SIGRTMIN+2].pname = CSAVS(2, 70, "Third Realtime Signal");
767         }
768
769         if (mesg[SIGRTMIN+3].pname == NULL) {
770             mesg[SIGRTMIN+3].iname = "RTMIN+3";
771             mesg[SIGRTMIN+3].pname = CSAVS(2, 71, "Fourth Realtime Signal");
772         }
773     }
774 #endif /* SIGRTMIN */
775
776 #ifdef SIGRTMAX
777     /*
778      * Cannot do this at compile time; Solaris2 uses _sysconf for these
779      */
780     if (SIGRTMAX > 0 && SIGRTMAX < NUMSIG) { 
781         if (mesg[SIGRTMAX-3].pname == NULL) {
782             mesg[SIGRTMAX-3].iname = "RTMAX-3";
783             mesg[SIGRTMAX-3].pname = CSAVS(2, 72,
784                                            "Fourth Last Realtime Signal");
785         }
786
787         if (mesg[SIGRTMAX-2].pname == NULL) {
788             mesg[SIGRTMAX-2].iname = "RTMAX-2";
789             mesg[SIGRTMAX-2].pname = CSAVS(2, 73,
790                                            "Third Last Realtime Signal");
791         }
792
793         if (mesg[SIGRTMAX-1].pname == NULL) {
794             mesg[SIGRTMAX-1].iname = "RTMAX-1";
795             mesg[SIGRTMAX-1].pname = CSAVS(2, 74,
796                                            "Second Last Realtime Signal");
797         }
798
799         if (mesg[SIGRTMAX].pname == NULL) {
800             mesg[SIGRTMAX].iname = "RTMAX";
801             mesg[SIGRTMAX].pname = CSAVS(2, 75,
802                                          "Last Realtime Signal");
803         }
804     }
805 #endif /* SIGRTMAX */
806
807
808 #ifdef SIGAIO
809     /* aiws */
810     if (mesg[SIGAIO].pname == NULL) {
811         mesg[SIGAIO].iname = "AIO";
812         mesg[SIGAIO].pname = CSAVS(2, 76, "LAN Asyncronous I/O");
813     }
814 #endif /* SIGAIO */
815
816 #ifdef SIGPTY
817     /* aiws */
818     if (mesg[SIGPTY].pname == NULL) {
819         mesg[SIGPTY].iname = "PTY";
820         mesg[SIGPTY].pname = CSAVS(2, 77, "PTY read/write availability");
821     }
822 #endif /* SIGPTY */
823
824 #ifdef SIGIOINT
825     /* aiws */
826     if (mesg[SIGIOINT].pname == NULL) {
827         mesg[SIGIOINT].iname = "IOINT";
828         mesg[SIGIOINT].pname = CSAVS(2, 78, "I/O intervention required");
829     }
830 #endif /* SIGIOINT */
831
832 #ifdef SIGGRANT
833     /* aiws */
834     if (mesg[SIGGRANT].pname == NULL) {
835         mesg[SIGGRANT].iname = "GRANT";
836         mesg[SIGGRANT].pname = CSAVS(2, 79, "HFT monitor mode granted");
837     }
838 #endif /* SIGGRANT */
839
840 #ifdef SIGRETRACT
841     /* aiws */
842     if (mesg[SIGRETRACT].pname == NULL) {
843         mesg[SIGRETRACT].iname = "RETRACT";
844         mesg[SIGRETRACT].pname = CSAVS(2, 80,
845                                   "HFT monitor mode should be relinguished");
846     }
847 #endif /* SIGRETRACT */
848
849 #ifdef SIGSOUND
850     /* aiws */
851     if (mesg[SIGSOUND].pname == NULL) {
852         mesg[SIGSOUND].iname = "SOUND";
853         mesg[SIGSOUND].pname = CSAVS(2, 81, "HFT sound control has completed");
854     }
855 #endif /* SIGSOUND */
856
857 #ifdef SIGSMSG
858     /* aiws */
859     if (mesg[SIGSMSG].pname == NULL) {
860         mesg[SIGSMSG].iname = "SMSG";
861         mesg[SIGSMSG].pname = CSAVS(2, 82, "Data in HFT ring buffer");
862     }
863 #endif /* SIGMSG */
864
865 #ifdef SIGMIGRATE
866     /* IBMAIX */
867     if (mesg[SIGMIGRATE].pname == NULL) {
868         mesg[SIGMIGRATE].iname = "MIGRATE";
869         mesg[SIGMIGRATE].pname = CSAVS(2, 83, "Migrate process");
870     }
871 #endif /* SIGMIGRATE */
872
873 #ifdef SIGSAK
874     /* IBMAIX */
875     if (mesg[SIGSAK].pname == NULL) {
876         mesg[SIGSAK].iname = "SAK";
877         mesg[SIGSAK].pname = CSAVS(2, 84, "Secure attention key");
878     }
879 #endif /* SIGSAK */
880
881 #ifdef SIGRESCHED
882     /* CX/UX */
883     if (mesg[SIGRESCHED].pname == NULL) {
884         mesg[SIGRESCHED].iname = "RESCHED";
885         mesg[SIGRESCHED].pname = CSAVS(2, 85, "Reschedule");
886     }
887 #endif /* SIGRESCHED */
888
889 #ifdef SIGDEBUG
890     /* VMS_POSIX */
891     if (mesg[SIGDEBUG].pname == NULL) {
892         mesg[SIGDEBUG].iname = "DEBUG";
893         mesg[SIGDEBUG].pname = CSAVS(2, 86, "Signaling SS$_DEBUG");
894     }
895 #endif /* SIGDEBUG */
896
897 #ifdef SIGPRIO
898     /* Lynx */
899     if (mesg[SIGPRIO].pname == NULL) {
900         mesg[SIGPRIO].iname = "PRIO";
901         mesg[SIGPRIO].pname = CSAVS(2, 87, "Priority changed");
902     }
903 #endif /* SIGPRIO */
904
905 #ifdef SIGDLK
906     /* cray */
907     if (mesg[SIGDLK].pname == NULL) {
908         mesg[SIGDLK].iname = "DLK";
909         mesg[SIGDLK].pname = CSAVS(2, 88, "True deadlock detected");
910     }
911 #endif /* SIGDLK */
912
913 #ifdef SIGTINT
914     /* masscomp */
915     if (mesg[SIGTINT].pname == NULL) {
916         mesg[SIGTINT].iname = "TINT";
917         mesg[SIGTINT].pname = CSAVS(2, 89, "New input character");
918     }
919 #endif /* SIGTINT */
920
921 #ifdef SIGSTKFLT
922     if (mesg[SIGSTKFLT].pname == NULL) {
923         mesg[SIGSTKFLT].iname = "STKFLT";
924         mesg[SIGSTKFLT].pname = CSAVS(2, 90, "Stack limit exceeded");
925     }
926 #endif /* SIGSTKFLT */
927
928 #ifdef SIGUNUSED
929     if (mesg[SIGUNUSED].pname == NULL) {
930         mesg[SIGUNUSED].iname = "UNUSED";
931         mesg[SIGUNUSED].pname = CSAVS(2, 91, "Unused signal");
932     }
933 #endif /* SIGUNUSED */
934
935 #ifdef SIGOVLY
936     /* SX-4 */
937     if (mesg[SIGOVLY].pname == NULL) {
938         mesg[SIGOVLY].iname = "OVLY";
939         mesg[SIGOVLY].pname = CSAVS(2, 92, "LM overlay");
940     }
941 #endif /* SIGOVLY */
942
943 #ifdef SIGFRZ
944     /* SX-4 */
945     if (mesg[SIGFRZ].pname == NULL) {
946         mesg[SIGFRZ].iname = "FRZ";
947         mesg[SIGFRZ].pname = CSAVS(2, 93, "system freeze");
948     }
949 #endif /* SIGFRZ */
950
951 #ifdef SIGDFRZ
952     /* SX-4 */
953     if (mesg[SIGDFRZ].pname == NULL) {
954         mesg[SIGDFRZ].iname = "DFRZ";
955         mesg[SIGDFRZ].pname = CSAVS(2, 94, "system defreeze");
956     }
957 #endif /* SIGDFRZ */
958
959 #ifdef SIGDEAD
960     /* SX-4 */
961     if (mesg[SIGDEAD].pname == NULL) {
962         mesg[SIGDEAD].iname = "DEAD";
963         mesg[SIGDEAD].pname = CSAVS(2, 95, "dead lock");
964     }
965 #endif /* SIGDEAD */
966
967 #ifdef SIGXMEM
968     /* SX-4 */
969     if (mesg[SIGXMEM].pname == NULL) {
970         mesg[SIGXMEM].iname = "XMEM";
971         mesg[SIGXMEM].pname = CSAVS(2, 96, "exceeded memory size limit");
972     }
973 #endif /* SIGXMEM */
974
975 #ifdef SIGXDSZ
976     /* SX-4 */
977     if (mesg[SIGXDSZ].pname == NULL) {
978         mesg[SIGXDSZ].iname = "XDSZ";
979         mesg[SIGXDSZ].pname = CSAVS(2, 97, "exceeded data size limit");
980     }
981 #endif /* SIGXDSZ */
982
983 #ifdef SIGMEM32
984     /* SX-4 */
985     if (mesg[SIGMEM32].pname == NULL) {
986         mesg[SIGMEM32].iname = "MEM32";
987         mesg[SIGMEM32].pname = CSAVS(2, 98, "exceeded memory size limit of 32KB");
988     }
989 #endif /* SIGMEM32 */
990
991 #ifdef SIGNMEM
992     /* SX-4 */
993     if (mesg[SIGNMEM].pname == NULL) {
994         mesg[SIGNMEM].iname = "NMEM";
995         mesg[SIGNMEM].pname = CSAVS(2, 99, "exce error for no memory");
996     }
997 #endif /* SIGNMEM */
998
999 #ifdef SIGCHKP
1000     /* SX-4 */
1001     if (mesg[SIGCHKP].pname == NULL) {
1002         mesg[SIGCHKP].iname = "CHKP";
1003         mesg[SIGCHKP].pname = CSAVS(2, 100, "check point start");
1004     }
1005 #endif /* SIGCHKP */
1006
1007 #ifdef SIGKCHKP
1008 #if 0
1009     /* SX-4 */
1010     if (mesg[SIGKCHKP].pname == NULL) {
1011         mesg[SIGKCHKP].iname = "KCHKP";
1012         mesg[SIGKCHKP].pname = CSAVS(2, 101, "check point start of kernel");
1013     }
1014 #endif
1015 #endif /* SIGKCHKP */
1016
1017 #ifdef SIGRSTA
1018     /* SX-4 */
1019     if (mesg[SIGRSTA].pname == NULL) {
1020         mesg[SIGRSTA].iname = "RSTA";
1021         mesg[SIGRSTA].pname = CSAVS(2, 102, "restart start");
1022     }
1023 #endif /* SIGRSTA */
1024
1025 #ifdef SIGKRSTA
1026 #if 0
1027     /* SX-4 */
1028     if (mesg[SIGKRSTA].pname == NULL) {
1029         mesg[SIGKRSTA].iname = "KRSTA";
1030         mesg[SIGKRSTA].pname = CSAVS(2, 103, "restart of kernel");
1031     }
1032 #endif
1033 #endif /* SIGKRSTA */
1034
1035 #ifdef SIGXXMU
1036     /* SX-4 */
1037     if (mesg[SIGXXMU].pname == NULL) {
1038         mesg[SIGXXMU].iname = "XXMU";
1039         mesg[SIGXXMU].pname = CSAVS(2, 104, "exeeded XMU size limit");
1040     }
1041 #endif /* SIGXXMU */
1042
1043 #ifdef SIGXRLG0
1044     /* SX-4 */
1045     if (mesg[SIGXRLG0].pname == NULL) {
1046         mesg[SIGXRLG0].iname = "XRLG0";
1047         mesg[SIGXRLG0].pname = CSAVS(2, 105, "exeeded RLG0 limit");
1048     }
1049 #endif /* SIGXRLG0 */
1050
1051 #ifdef SIGXRLG1
1052     /* SX-4 */
1053     if (mesg[SIGXRLG1].pname == NULL) {
1054         mesg[SIGXRLG1].iname = "XRLG1";
1055         mesg[SIGXRLG1].pname = CSAVS(2, 106, "exeeded RLG1 limit");
1056     }
1057 #endif /* SIGXRLG1 */
1058
1059 #ifdef SIGXRLG2
1060     /* SX-4 */
1061     if (mesg[SIGXRLG2].pname == NULL) {
1062         mesg[SIGXRLG2].iname = "XRLG2";
1063         mesg[SIGXRLG2].pname = CSAVS(2, 107, "exeeded RLG2 limit");
1064     }
1065 #endif /* SIGXRLG2 */
1066
1067 #ifdef SIGXRLG3
1068     /* SX-4 */
1069     if (mesg[SIGXRLG3].pname == NULL) {
1070         mesg[SIGXRLG3].iname = "XRLG3";
1071         mesg[SIGXRLG3].pname = CSAVS(2, 108, "exeeded RLG3 limit");
1072     }
1073 #endif /* SIGXRLG3 */
1074 }