Kernel: raise() now force sends signal

This commit is contained in:
Bananymous 2023-07-30 14:17:07 +03:00
parent 879706e6e9
commit a152d0aac5
2 changed files with 6 additions and 10 deletions

View File

@ -867,15 +867,7 @@ namespace Kernel
ASSERT(this == &Process::current());
CriticalScope _;
// FIXME: support raise with signal blocked
Thread& current = Thread::current();
if (current.add_signal(signal))
{
current.handle_signal(signal);
return 0;
}
Thread::current().handle_signal(-signal);
ASSERT_NOT_REACHED();
}

View File

@ -253,13 +253,17 @@ namespace Kernel
}
ASSERT(signal <= _SIGMAX);
}
else
else if (signal > 0)
{
uint64_t full_pending_mask = m_signal_pending_mask | process().m_signal_pending_mask;
uint64_t mask = 1ull << signal;
ASSERT(full_pending_mask & mask);
ASSERT(!(m_signal_block_mask & mask));
}
else
{
signal = -signal;
}
uintptr_t& return_rsp = this->return_rsp();
uintptr_t& return_rip = this->return_rip();