LibC: Fix strsignal() and implement psignal()

This commit is contained in:
2024-08-05 00:59:03 +03:00
parent a749b9806e
commit adadb10b15
2 changed files with 37 additions and 28 deletions

View File

@@ -1,5 +1,6 @@
#include <BAN/Assert.h>
#include <signal.h>
#include <string.h>
#include <sys/syscall.h>
#include <unistd.h>
@@ -10,6 +11,14 @@ int kill(pid_t pid, int sig)
return syscall(SYS_KILL, pid, sig);
}
void psignal(int signum, const char* message)
{
if (message && *message)
fprintf(stderr, "%s: %s\n", message, strsignal(signum));
else
fprintf(stderr, "%s\n", strsignal(signum));
}
int raise(int sig)
{
// FIXME: won't work after multithreaded