diff options
author | netchild <netchild@FreeBSD.org> | 2006-08-28 13:09:24 +0000 |
---|---|---|
committer | netchild <netchild@FreeBSD.org> | 2006-08-28 13:09:24 +0000 |
commit | 4dda206f9cb1f60cabe2d7c0b47728fab3a16e84 (patch) | |
tree | 500b8ba6718178eef947c5c36287eb3fee291258 /sys | |
parent | faa99f19101b42819ba6cff6c382b5b8db90e36e (diff) | |
download | FreeBSD-src-4dda206f9cb1f60cabe2d7c0b47728fab3a16e84.zip FreeBSD-src-4dda206f9cb1f60cabe2d7c0b47728fab3a16e84.tar.gz |
MFi386 parts of rev 1.55 (modulo real MD parts):
- implement CLONE_PARENT semantic
- lock proc in the currently disabled part of CLONE_THREAD
Submitted by: rdivacky
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/linux32/linux32_machdep.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c index a792e72..a553602 100644 --- a/sys/amd64/linux32/linux32_machdep.c +++ b/sys/amd64/linux32/linux32_machdep.c @@ -570,24 +570,24 @@ linux_clone(struct thread *td, struct linux_clone_args *args) } } - if (args->flags & CLONE_PARENT) { -#ifdef DEBUG - printf("linux_clone: CLONE_PARENT\n"); -#endif + if (args->flags & (CLONE_PARENT|CLONE_THREAD)) { + sx_xlock(&proctree_lock); + PROC_LOCK(p2); + proc_reparent(p2, td->td_proc->p_pptr); + PROC_UNLOCK(p2); + sx_xunlock(&proctree_lock); } - + if (args->flags & CLONE_THREAD) { /* XXX: linux mangles pgrp and pptr somehow * I think it might be this but I am not sure. */ #ifdef notyet + PROC_LOCK(p2); p2->p_pgrp = td->td_proc->p_pgrp; - p2->p_pptr = td->td_proc->p_pptr; + PROC_UNLOCK(p2); #endif exit_signal = 0; -#ifdef DEBUG - printf("linux_clone: CLONE_THREADS\n"); -#endif } if (args->flags & CLONE_CHILD_SETTID) @@ -599,6 +599,7 @@ linux_clone(struct thread *td, struct linux_clone_args *args) em->child_clear_tid = args->child_tidptr; else em->child_clear_tid = NULL; + EMUL_UNLOCK(&emul_lock); PROC_LOCK(p2); |