Make __WCLONE option for wait4(2) and flags for clone(2) work properly.

This commit is contained in:
Naoki Hamada
2014-09-29 16:28:55 +09:00
committed by Tomoki Shirasawa
parent 66db108dd3
commit 2997274470
3 changed files with 31 additions and 7 deletions

View File

@@ -202,6 +202,11 @@ struct process *clone_process(struct process *org, unsigned long pc,
unsigned long sp, int clone_flags)
{
struct process *proc;
int termsig = clone_flags & 0xff;
if (termsig < 0 || _NSIG < termsig) {
return -EINVAL;
}
if ((proc = ihk_mc_alloc_pages(KERNEL_STACK_NR_PAGES,
IHK_MC_AP_NOWAIT)) == NULL) {
@@ -228,6 +233,8 @@ struct process *clone_process(struct process *org, unsigned long pc,
goto err_free_sigshared;
}
proc->ftn->termsig = termsig;
init_fork_tree_node(proc->ftn, (clone_flags & CLONE_VM) ? NULL : org->ftn,
proc);