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:
Wang Chao 2010-08-05 14:58:37 +08:00 committed by Dmitry V. Levin
parent 304ea5f067
commit 5a22b31a60

View File

@ -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 */
}