From: Rich Felker Date: Wed, 8 Jun 2011 20:41:44 +0000 (-0400) Subject: implement psignal and psiginfo X-Git-Tag: v0.7.11~63 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ecc0f5138dd784eadea66f5b244515a98b381d39;p=oweals%2Fmusl.git implement psignal and psiginfo --- 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 +#include +#include + +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); +} diff --git a/src/signal/psignal.c b/src/signal/psignal.c new file mode 100644 index 00000000..02f1c760 --- /dev/null +++ b/src/signal/psignal.c @@ -0,0 +1,10 @@ +#include +#include +#include + +void psignal(int sig, const char *msg) +{ + char *s = strsignal(sig); + if (msg) fprintf(stderr, "%s: %s\n", msg, s); + else fprintf(stderr, "%s\n", s); +}