Handle CLONE_PARENT flag
* process.c (internal_fork): The parent of new cloned process is the same of the calling process when CLONE_PARENT is set.
This commit is contained in:
parent
304ea5f067
commit
5a22b31a60
10
process.c
10
process.c
@ -915,6 +915,16 @@ Process %u resumed (parent %d ready)\n",
|
||||
tcpchild->flags |= TCB_CLONE_DETACHED;
|
||||
++tcp->nclone_detached;
|
||||
}
|
||||
if ((call_flags & CLONE_PARENT) &&
|
||||
!(call_flags & CLONE_THREAD)) {
|
||||
--tcp->nchildren;
|
||||
tcpchild->parent = NULL;
|
||||
if (tcp->parent != NULL) {
|
||||
tcp = tcp->parent;
|
||||
tcpchild->parent = tcp;
|
||||
++tcp->nchildren;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* TCB_CLONE_THREAD */
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user