* when forking a team, not only the signal mask, but also the sig_actions
and the signal stack must be copied into the new thread (at least that's what I could make of IEEE Std 1003.1-2001 regarding the expected behaviour of fork) This brings down the failures of the rsync test suite from 24 to 18 ... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30807 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -77,6 +77,11 @@ struct fork_arg {
|
|||||||
size_t user_stack_size;
|
size_t user_stack_size;
|
||||||
addr_t user_local_storage;
|
addr_t user_local_storage;
|
||||||
sigset_t sig_block_mask;
|
sigset_t sig_block_mask;
|
||||||
|
struct sigaction sig_action[32];
|
||||||
|
addr_t signal_stack_base;
|
||||||
|
size_t signal_stack_size;
|
||||||
|
bool signal_stack_enabled;
|
||||||
|
|
||||||
struct user_thread* user_thread;
|
struct user_thread* user_thread;
|
||||||
|
|
||||||
struct arch_fork_arg arch_info;
|
struct arch_fork_arg arch_info;
|
||||||
@@ -1458,6 +1463,11 @@ fork_team_thread_start(void *_args)
|
|||||||
thread->user_local_storage = forkArgs->user_local_storage;
|
thread->user_local_storage = forkArgs->user_local_storage;
|
||||||
thread->sig_block_mask = forkArgs->sig_block_mask;
|
thread->sig_block_mask = forkArgs->sig_block_mask;
|
||||||
thread->user_thread = forkArgs->user_thread;
|
thread->user_thread = forkArgs->user_thread;
|
||||||
|
memcpy(thread->sig_action, forkArgs->sig_action,
|
||||||
|
sizeof(forkArgs->sig_action));
|
||||||
|
thread->signal_stack_base = forkArgs->signal_stack_base;
|
||||||
|
thread->signal_stack_size = forkArgs->signal_stack_size;
|
||||||
|
thread->signal_stack_enabled = forkArgs->signal_stack_enabled;
|
||||||
|
|
||||||
arch_thread_init_tls(thread);
|
arch_thread_init_tls(thread);
|
||||||
|
|
||||||
@@ -1587,6 +1597,12 @@ fork_team(void)
|
|||||||
forkArgs->user_stack_size = parentThread->user_stack_size;
|
forkArgs->user_stack_size = parentThread->user_stack_size;
|
||||||
forkArgs->user_local_storage = parentThread->user_local_storage;
|
forkArgs->user_local_storage = parentThread->user_local_storage;
|
||||||
forkArgs->sig_block_mask = parentThread->sig_block_mask;
|
forkArgs->sig_block_mask = parentThread->sig_block_mask;
|
||||||
|
memcpy(forkArgs->sig_action, parentThread->sig_action,
|
||||||
|
sizeof(forkArgs->sig_action));
|
||||||
|
forkArgs->signal_stack_base = parentThread->signal_stack_base;
|
||||||
|
forkArgs->signal_stack_size = parentThread->signal_stack_size;
|
||||||
|
forkArgs->signal_stack_enabled = parentThread->signal_stack_enabled;
|
||||||
|
|
||||||
arch_store_fork_frame(&forkArgs->arch_info);
|
arch_store_fork_frame(&forkArgs->arch_info);
|
||||||
|
|
||||||
// copy image list
|
// copy image list
|
||||||
|
|||||||
Reference in New Issue
Block a user