Subject: Re: fork1 and new stack
To: None <eeh@netbsd.org>
From: Emmanuel Dreyfus <manu@netbsd.org>
List: tech-kern
Date: 04/26/2002 19:35:26
> Where's the bit where you allocate and map in the new stack?

Just a few lines later:

        bzero(&vmc, sizeof(vmc));
        vmc.ev_addr = trunc_page(child_stack_addr - child_stack_size);
        vmc.ev_len = round_page(child_stack_size);
        vmc.ev_prot = UVM_PROT_RWX;
        vmc.ev_flags = UVM_FLAG_COPYONW|UVM_FLAG_FIXED|UVM_FLAG_OVERLAY;
        vmc.ev_proc = vmcmd_map_zero;
        error = (*vmc.ev_proc)(p, &vmc);

Another problem:
I assumed that the child will not be scheduled until the parent returns
to userland, and thus that I can setup the child after calling fork1().
Is it true on a SMP system?

-- 
Emmanuel Dreyfus.  
manu@netbsd.org