1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 22:15:06 +00:00

Kernel: Preserve signal mask across fork(2) and execve(2)

A child created via fork(2) inherits a copy of its parent's signal
mask; the signal mask is preserved across execve(2).
This commit is contained in:
Idan Horowitz 2021-12-11 17:18:39 +02:00
parent 0301180f88
commit 92a6c91f4e
3 changed files with 5 additions and 2 deletions

View file

@ -681,7 +681,7 @@ u32 Thread::signal_mask_block(sigset_t signal_set, bool block)
void Thread::clear_signals()
{
SpinlockLocker lock(g_scheduler_lock);
m_signal_mask = 0;
// The signal mask is preserved across execve(2).
m_pending_signals = 0;
m_have_any_unmasked_pending_signals.store(false, AK::memory_order_release);
m_signal_action_data.fill({});