Create clone'd linux processes as stopped processes at first and don't

actually make them runnable until after the emulator layer has had a chance
to perform fixups.
This commit is contained in:
jhb 2001-03-06 02:59:46 +00:00
parent 2825ea44c1
commit 9e3fd23ce6
2 changed files with 18 additions and 3 deletions

View File

@ -118,7 +118,7 @@ linux_vfork(struct proc *p, struct linux_vfork_args *args)
int
linux_clone(struct proc *p, struct linux_clone_args *args)
{
int error, ff = RFPROC;
int error, ff = RFPROC | RFSTOPPED;
struct proc *p2;
int exit_signal;
vm_offset_t start;
@ -175,8 +175,15 @@ linux_clone(struct proc *p, struct linux_clone_args *args)
(long)p2->p_pid, args->stack, exit_signal);
#endif
/*
* Make this runnable after we are finished with it.
*/
mtx_lock_spin(&sched_lock);
p2->p_stat = SRUN;
setrunqueue(p2);
mtx_unlock_spin(&sched_lock);
return (0);
}
#define STACK_SIZE (2 * 1024 * 1024)

View File

@ -218,7 +218,7 @@ linux_vfork(struct proc *p, struct linux_vfork_args *args)
int
linux_clone(struct proc *p, struct linux_clone_args *args)
{
int error, ff = RFPROC;
int error, ff = RFPROC | RFSTOPPED;
struct proc *p2;
int exit_signal;
vm_offset_t start;
@ -275,6 +275,14 @@ linux_clone(struct proc *p, struct linux_clone_args *args)
(long)p2->p_pid);
#endif
/*
* Make this runnable after we are finished with it.
*/
mtx_lock_spin(&sched_lock);
p2->p_stat = SRUN;
setrunqueue(p2);
mtx_unlock_spin(&sched_lock);
return (0);
}