mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
syscalls/invalid: raise SIGSYS and print message on an invalid system call
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
#include <kernel/syscalls.h>
|
#include <kernel/syscalls.h>
|
||||||
|
#include <arch/cpu.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
syscallret_t syscall_invalid() {
|
syscallret_t syscall_invalid() {
|
||||||
@@ -6,5 +7,10 @@ syscallret_t syscall_invalid() {
|
|||||||
.errno = ENOSYS,
|
.errno = ENOSYS,
|
||||||
.ret = -1
|
.ret = -1
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
printf("Detected invalid system call, raising SIGSYS and returning ENOSYS\n");
|
||||||
|
signal_signalthread(current_thread(), SIGSYS, true);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user