summaryrefslogtreecommitdiff
path: root/src/signal/psiginfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/signal/psiginfo.c')
-rw-r--r--src/signal/psiginfo.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/signal/psiginfo.c b/src/signal/psiginfo.c
new file mode 100644
index 00000000..fa46d2bf
--- /dev/null
+++ b/src/signal/psiginfo.c
@@ -0,0 +1,10 @@
+#include <stdio.h>
+#include <string.h>
+#include <signal.h>
+
+void psiginfo(siginfo_t *si, const char *msg)
+{
+ char *s = strsignal(si->si_signo);
+ if (msg) fprintf(stderr, "%s: %s\n", msg, s);
+ else fprintf(stderr, "%s\n", s);
+}