Skip to content

Commit

Permalink
syscalls: dispatch sigaction()
Browse files Browse the repository at this point in the history
  • Loading branch information
jewelcodes committed Nov 20, 2024
1 parent 2db1134 commit 2ad11c9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/syscalls/dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,14 @@ void syscallDispatchKill(SyscallRequest *req) {
req->unblock = true;
}

void syscallDispatchSigAction(SyscallRequest *req) {
if((!req->params[1] || (req->params[1] && syscallVerifyPointer(req, req->params[1], sizeof(struct sigaction)))) &&
(!req->params[2] || (req->params[2] && syscallVerifyPointer(req, req->params[2], sizeof(struct sigaction))))) {
req->ret = sigaction(req->thread, req->params[0], (const struct sigaction *) req->params[1], (struct sigaction *) req->params[2]);
req->unblock = true;
}
}

/* Group 4: Memory Management */

void syscallDispatchSBrk(SyscallRequest *req) {
Expand Down Expand Up @@ -590,7 +598,7 @@ void (*syscallDispatchTable[])(SyscallRequest *) = {
syscallDispatchRecv, // 45 - recv()
syscallDispatchSend, // 46 - send()
syscallDispatchKill, // 47 - kill()
NULL, // 48 - sigaction()
syscallDispatchSigAction, // 48 - sigaction()
NULL, // 49 - sigreturn()

/* group 4: memory management */
Expand Down

0 comments on commit 2ad11c9

Please sign in to comment.