head 1.4; access; symbols; locks; strict; comment @ * @; 1.4 date 93.02.26.21.57.34; author jromine; state Exp; branches; next 1.3; 1.3 date 92.12.15.00.20.22; author jromine; state Exp; branches; next 1.2; 1.2 date 92.12.14.17.47.34; author jromine; state Exp; branches; next 1.1; 1.1 date 92.12.14.17.44.38; author jromine; state Exp; branches; next ; desc @@ 1.4 log @BSd44 @ text @/* pidstatus.c - report child's status */ #ifndef lint static char ident[] = "@@(#)$Id: pidstatus.c,v 1.3 1992/12/15 00:20:22 jromine Exp jromine $"; #endif /* lint */ #include "../h/mh.h" #include #include #ifndef BSD44 #ifndef BSD42 static char *sigs[] = { NULL, "Hangup", "Interrupt", "Quit", "Illegal instruction", "Trace/BPT trap", "IOT trap", "EMT trap", "Floating exception", "Killed", "Bus error", "Segmentation fault", "Bad system call", "Broken pipe", "Alarm clock", "Terminated", #ifdef SIGURG "Urgent I/O condition", #else NULL, #endif "Stopped (signal)", "Stopped", "Continued", "Child exited", "Stopped (tty input)", "Stopped (tty output)", "Tty input interrupt", "Cputime limit exceeded", "Filesize limit exceeded", NULL }; #else extern char *sys_siglist[]; #endif /* BSD42 */ #endif /* BSD44 defines sys_siglist in signal.h */ /* */ int pidstatus (status, fp, cp) register int status; register FILE *fp; register char *cp; { int signum; if ((status & 0xff00) == 0xff00) return status; switch (signum = status & 0x007f) { case OK: if (signum = ((status & 0xff00) >> 8)) { if (cp) fprintf (fp, "%s: ", cp); fprintf (fp, "Exit %d\n", signum); } break; case SIGINT: break; default: if (cp) fprintf (fp, "%s: ", cp); #ifndef BSD42 if (signum >= sizeof sigs || sigs[signum] == NULL) fprintf (fp, "Signal %d", signum); else fprintf (fp, "%s", sigs[signum]); #else /* BSD42 */ if (signum >= NSIG) fprintf (fp, "Signal %d", signum); else fprintf (fp, "%s", sys_siglist[signum]); #endif /* BSD42 */ fprintf (fp, "%s\n", status & 0x80 ? " (core dumped)" : ""); break; } return status; } @ 1.3 log @endif sugar @ text @d3 1 a3 1 static char ident[] = "@@(#)$Id: pidstatus.c,v 1.2 1992/12/14 17:47:34 jromine Exp jromine $"; d11 1 d49 1 @ 1.2 log @add id @ text @d3 1 a3 1 static char ident[] = "@@(#)$Id: pidwait.c,v 1.9 1992/12/14 17:10:58 jromine Exp $"; d47 1 a47 1 #endif BSD42 d81 1 a81 1 #else BSD42 d86 1 a86 1 #endif BSD42 @ 1.1 log @Initial revision @ text @d2 3 @