mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 20:58:22 +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 <arch/cpu.h>
|
||||
#include <errno.h>
|
||||
|
||||
syscallret_t syscall_invalid() {
|
||||
@@ -6,5 +7,10 @@ syscallret_t syscall_invalid() {
|
||||
.errno = ENOSYS,
|
||||
.ret = -1
|
||||
};
|
||||
|
||||
|
||||
printf("Detected invalid system call, raising SIGSYS and returning ENOSYS\n");
|
||||
signal_signalthread(current_thread(), SIGSYS, true);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user