110901Ssam /* 235285Sbostic * Copyright (c) 1983 Regents of the University of California. 335285Sbostic * All rights reserved. 435285Sbostic * 542625Sbostic * %sccs.include.redist.c% 621353Sdist */ 721353Sdist 826576Sdonn #if defined(LIBC_SCCS) && !defined(lint) 9*46597Sdonn static char sccsid[] = "@(#)psignal.c 5.6 (Berkeley) 02/23/91"; 1035285Sbostic #endif /* LIBC_SCCS and not lint */ 1121353Sdist 1221353Sdist /* 1310901Ssam * Print the name of the signal indicated 1410901Ssam * along with the supplied message. 1510901Ssam */ 1645646Sbostic #include <sys/signal.h> 17*46597Sdonn #include <string.h> 1845646Sbostic #include <unistd.h> 1910901Ssam 20*46597Sdonn void 2110901Ssam psignal(sig, s) 2235285Sbostic unsigned int sig; 23*46597Sdonn const char *s; 2410901Ssam { 2510901Ssam register char *c; 2635285Sbostic register int n; 2710901Ssam 2810901Ssam if (sig < NSIG) 2910901Ssam c = sys_siglist[sig]; 3035285Sbostic else 3135285Sbostic c = "Unknown signal"; 3210901Ssam n = strlen(s); 3310901Ssam if (n) { 3445646Sbostic (void)write(STDERR_FILENO, s, n); 3545646Sbostic (void)write(STDERR_FILENO, ": ", 2); 3610901Ssam } 3745646Sbostic (void)write(STDERR_FILENO, c, strlen(c)); 3845646Sbostic (void)write(STDERR_FILENO, "\n", 1); 3910901Ssam } 40