diff options
author | Ian Moffett <ian@osmora.org> | 2024-08-12 22:05:00 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-08-12 22:13:46 -0400 |
commit | 8970ddd9be6c013ff8cae2b1872f65348c7ded54 (patch) | |
tree | 8fa83fde9cd319ce6ff67b2af052e1a9d7e0d8e9 /sys/kern/kern_stub.c | |
parent | 30cb24fbc5700771208dddb9e5f42d0ae5d7ff38 (diff) |
kernel: Add initial support for signals
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern/kern_stub.c')
-rw-r--r-- | sys/kern/kern_stub.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/sys/kern/kern_stub.c b/sys/kern/kern_stub.c index 65688e2..5a53cc1 100644 --- a/sys/kern/kern_stub.c +++ b/sys/kern/kern_stub.c @@ -30,6 +30,39 @@ #include <sys/device.h> #include <sys/types.h> #include <sys/errno.h> +#include <sys/syslog.h> +#include <sys/proc.h> +#include <sys/signal.h> + +void +sigfpe_default(int signo) +{ + static struct proc *td; + + td = this_td(); + kprintf("Floating point exception (pid=%d)\n", td->pid); + exit1(td); +} + +void +sigkill_default(int signo) +{ + static struct proc *td; + + td = this_td(); + kprintf("Terminated (pid=%d)\n", td->pid); + exit1(td); +} + +void +sigsegv_default(int signo) +{ + static struct proc *td; + + td = this_td(); + kprintf("Segmentation fault (pid=%d)\n", td->pid); + exit1(td); +} int dev_noread(void) |