initial signal implementation

This commit is contained in:
Matheus
2024-05-14 15:04:48 -03:00
parent 00c212fa8d
commit 7b0cc4c51b
22 changed files with 824 additions and 55 deletions
+21
View File
@@ -0,0 +1,21 @@
#include <kernel/syscalls.h>
#include <arch/cpu.h>
syscallret_t syscall_sigaltstack(context_t *, stack_t *new, stack_t *old) {
syscallret_t ret = {
.ret = -1
};
stack_t newtmp, oldtmp;
if (new)
newtmp = *new;
signal_altstack(_cpu()->thread, new ? &newtmp : NULL, old ? &oldtmp : NULL);
if (old)
*old = oldtmp;
ret.errno = 0;
ret.ret = 0;
return ret;
}