mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:48:11 +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:
parent
0301180f88
commit
92a6c91f4e
3 changed files with 5 additions and 2 deletions
|
@ -43,6 +43,9 @@ ErrorOr<FlatPtr> Process::sys$fork(RegisterState& regs)
|
|||
dbgln_if(FORK_DEBUG, "fork: child={}", child);
|
||||
child->address_space().set_enforces_syscall_regions(address_space().enforces_syscall_regions());
|
||||
|
||||
// A child created via fork(2) inherits a copy of its parent's signal mask
|
||||
child_first_thread->update_signal_mask(Thread::current()->signal_mask());
|
||||
|
||||
#if ARCH(I386)
|
||||
auto& child_regs = child_first_thread->m_regs;
|
||||
child_regs.eax = 0; // fork() returns 0 in the child :^)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue