libc: log a message and exit for raise(...)

Fix #3919
This commit is contained in:
Emery Hemingway 2020-10-20 16:50:49 +02:00 committed by Christian Helmuth
parent 6ea628195f
commit b4076e762c
2 changed files with 17 additions and 1 deletions

View File

@ -123,7 +123,6 @@ DUMMY(void *, 0, ___mtctxres, (void))
DUMMY(void *, 0, __nsdefaultsrc, (void))
DUMMY(int , -1, _nsdispatch, (void))
DUMMY(long , -1, pathconf, (const char *, int))
DUMMY(int , -1, raise, (int))
DUMMY(int , -1, rmdir, (const char *))
DUMMY(void *, 0, sbrk, (intptr_t))
DUMMY(int , -1, sched_setparam, (pid_t, const sched_param *))

View File

@ -199,3 +199,20 @@ extern "C" int waitid(idtype_t idtype, id_t id, siginfo_t *info, int flags)
ret = 0;
return (ret);
}
extern "C" int raise(int sig)
{
char const *signame = sys_signame[sig];
switch(sig) {
case SIGQUIT:
case SIGABRT:
case SIGKILL:
error(__func__, "(", signame, ")");
exit(-1);
default:
warning(__func__, "(", signame, ") not implemented");
return Libc::Errno(EINVAL);
};
}