mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-28 23:39:02 +00:00
Kernel+LibC: Don't hardcode the maximum signal number everywhere
This commit is contained in:
parent
a39a341e26
commit
e79f0e2ee9
Notes:
sideshowbarker
2024-07-17 08:39:58 +09:00
Author: https://github.com/timschumi
Commit: e79f0e2ee9
Pull-request: https://github.com/SerenityOS/serenity/pull/14629
Reviewed-by: https://github.com/bgianfo
4 changed files with 9 additions and 9 deletions
|
@ -720,7 +720,7 @@ u32 Thread::pending_signals_for_state() const
|
|||
|
||||
void Thread::send_signal(u8 signal, [[maybe_unused]] Process* sender)
|
||||
{
|
||||
VERIFY(signal < 32);
|
||||
VERIFY(signal < NSIG);
|
||||
VERIFY(process().is_user_process());
|
||||
SpinlockLocker scheduler_lock(g_scheduler_lock);
|
||||
|
||||
|
@ -827,7 +827,7 @@ DispatchSignalResult Thread::dispatch_one_pending_signal()
|
|||
return DispatchSignalResult::Continue;
|
||||
|
||||
u8 signal = 1;
|
||||
for (; signal < 32; ++signal) {
|
||||
for (; signal < NSIG; ++signal) {
|
||||
if ((signal_candidates & (1 << (signal - 1))) != 0) {
|
||||
break;
|
||||
}
|
||||
|
@ -902,7 +902,7 @@ static DefaultSignalAction default_signal_action(u8 signal)
|
|||
|
||||
bool Thread::should_ignore_signal(u8 signal) const
|
||||
{
|
||||
VERIFY(signal < 32);
|
||||
VERIFY(signal < NSIG);
|
||||
auto const& action = m_process->m_signal_action_data[signal];
|
||||
if (action.handler_or_sigaction.is_null())
|
||||
return default_signal_action(signal) == DefaultSignalAction::Ignore;
|
||||
|
@ -911,14 +911,14 @@ bool Thread::should_ignore_signal(u8 signal) const
|
|||
|
||||
bool Thread::has_signal_handler(u8 signal) const
|
||||
{
|
||||
VERIFY(signal < 32);
|
||||
VERIFY(signal < NSIG);
|
||||
auto const& action = m_process->m_signal_action_data[signal];
|
||||
return !action.handler_or_sigaction.is_null();
|
||||
}
|
||||
|
||||
bool Thread::is_signal_masked(u8 signal) const
|
||||
{
|
||||
VERIFY(signal < 32);
|
||||
VERIFY(signal < NSIG);
|
||||
return (1 << (signal - 1)) & m_signal_mask;
|
||||
}
|
||||
|
||||
|
@ -969,7 +969,7 @@ DispatchSignalResult Thread::dispatch_signal(u8 signal)
|
|||
{
|
||||
VERIFY_INTERRUPTS_DISABLED();
|
||||
VERIFY(g_scheduler_lock.is_locked_by_current_processor());
|
||||
VERIFY(signal > 0 && signal <= 32);
|
||||
VERIFY(signal > 0 && signal <= NSIG);
|
||||
VERIFY(process().is_user_process());
|
||||
VERIFY(this == Thread::current());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue