summaryrefslogtreecommitdiff
path: root/libc/string/strsignal.c
diff options
context:
space:
mode:
authorDavid McCullough <davidm@snapgear.com>2001-02-26 02:54:33 +0000
committerDavid McCullough <davidm@snapgear.com>2001-02-26 02:54:33 +0000
commit62b59bd5ed8ff393c5f129dbd538966a2cfc0702 (patch)
tree97552252573c35029641f3203f0f3d762c867787 /libc/string/strsignal.c
parentc2ba9eda4a5cd8fa5f2b176cc75a21c4f671a992 (diff)
Added "psignal" function
Diffstat (limited to 'libc/string/strsignal.c')
-rw-r--r--libc/string/strsignal.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/libc/string/strsignal.c b/libc/string/strsignal.c
index e7915b26a..ba2524ffd 100644
--- a/libc/string/strsignal.c
+++ b/libc/string/strsignal.c
@@ -37,6 +37,9 @@
extern char *__ltostr(char *buf, long uval, int base, int uppercase);
+/********************** Function strsignal ************************************/
+#ifdef L_strsignal
+
#if WANT_SIGLIST
const char *const sys_siglist[] = {
@@ -79,8 +82,6 @@ const char *const sys_siglist[] = {
#define NUM_KNOWN_SIGNALS 32
-/********************** Function strsignal ************************************/
-
static char retbuf[28]; /* 28 is sufficient for 32 bit ints */
static const char unknown_signal[] = "Unknown Signal:";
@@ -104,6 +105,18 @@ char *strsignal(int sig)
return pos;
}
+#endif
+/********************** Function psignal ************************************/
+#ifdef L_psignal
+
+#include <stdio.h>
+
+void psignal(int sig, const char *s)
+{
+ fprintf(stderr, "%s: %s\n", s, strsignal(sig));
+}
+
+#endif
/********************** THE END ********************************************/
#ifdef CHECK_BUF