signal: add signal_returnmask and other fixes

This commit is contained in:
Matheus
2024-09-12 22:08:57 -03:00
parent cf3e58ffe1
commit 31c7cf881c
6 changed files with 15 additions and 12 deletions
+1 -1
View File
@@ -286,7 +286,7 @@ static syscallret_t execve(context_t *context, char *upath, char *uargv[], char
memset(&_cpu()->thread->signals.stack, 0, sizeof(stack_t));
// execve keeps information about ignored signals
for (int i = 0; i < NSIG; ++i) {
for (int i = 1; i < NSIG; ++i) {
bool ign = proc->signals.actions[i].address == SIG_IGN;
memset(&proc->signals.actions[i], 0, sizeof(sigaction_t));
if (ign)
+1 -3
View File
@@ -125,12 +125,10 @@ syscallret_t syscall_ppoll(context_t *context, pollfd_t *fds, size_t nfds, times
return ret;
signal_changemask(_cpu()->thread, SIG_SETMASK, &sigset, &savedset);
signal_returnmask(_cpu()->thread, &savedset);
}
syscallret_t ret = syscall_poll(context, fds, nfds, utimeout ? (timeout.s * 1000 + timeout.ns / 1000000) : -1);
if (usigset)
signal_changemask(_cpu()->thread, SIG_SETMASK, &savedset, NULL);
return ret;
}