mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:27:44 +00:00
Add strsignal() and improve sharing signal numbers between LibC and kernel.
This commit is contained in:
parent
8d1f8b2518
commit
7c3746592b
15 changed files with 153 additions and 60 deletions
|
@ -1,6 +1,7 @@
|
|||
#include "string.h"
|
||||
#include "errno.h"
|
||||
#include "stdio.h"
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
@ -157,7 +158,7 @@ char* strncat(char *dest, const char *src, size_t n)
|
|||
|
||||
const char* sys_errlist[] = {
|
||||
#undef __ERROR
|
||||
#define __ERROR(a, b) #b,
|
||||
#define __ERROR(a, b) b,
|
||||
__ENUMERATE_ALL_ERRORS
|
||||
#undef __ERROR
|
||||
};
|
||||
|
@ -170,8 +171,15 @@ char* strerror(int errnum)
|
|||
return "Unknown error";
|
||||
}
|
||||
return (char*)sys_errlist[errnum];
|
||||
}
|
||||
|
||||
char* strsignal(int signum)
|
||||
{
|
||||
if (signum >= __signal_count) {
|
||||
printf("strsignal() missing string for signum=%d\n", signum);
|
||||
return "Unknown signal";
|
||||
}
|
||||
return (char*)sys_siglist[signum];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue