Skip to content

Commit

Permalink
ipc: relay sigreturn() to arch-specific implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
jewelcodes committed Nov 26, 2024
1 parent 7e209de commit 521d935
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/include/kernel/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,4 @@ void signalHandle(Thread *);

int kill(Thread *, pid_t, int);
int sigaction(Thread *, int, const struct sigaction *, struct sigaction *);
void sigreturn(Thread *);
11 changes: 11 additions & 0 deletions src/ipc/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,15 @@ int sigaction(Thread *t, int sig, const struct sigaction *act, struct sigaction
memcpy(&handlers[sig-1], act, sizeof(struct sigaction));
releaseLock(&t->lock);
return 0;
}

/* sigreturn(): returns from a signal handler and restores previous state
* params: t - calling thread
* returns: nothing
*/

void sigreturn(Thread *t) {
if(!t->handlingSignal) return;
platformSigreturn(t);
t->handlingSignal = false;
}

0 comments on commit 521d935

Please sign in to comment.