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