Commit | Line | Data |
---|---|---|
1638bfce SL |
1 | /* @(#)psignal.c 4.1 (Berkeley) %G% */ |
2 | /* | |
3 | * Print the name of the signal indicated | |
4 | * along with the supplied message. | |
5 | */ | |
6 | #include <signal.h> | |
7 | ||
8 | extern char *sys_siglist[]; | |
9 | ||
10 | psignal(sig, s) | |
11 | unsigned sig; | |
12 | char *s; | |
13 | { | |
14 | register char *c; | |
15 | register n; | |
16 | ||
17 | c = "Unknown signal"; | |
18 | if (sig < NSIG) | |
19 | c = sys_siglist[sig]; | |
20 | n = strlen(s); | |
21 | if (n) { | |
22 | write(2, s, n); | |
23 | write(2, ": ", 2); | |
24 | } | |
25 | write(2, c, strlen(c)); | |
26 | write(2, "\n", 1); | |
27 | } |