[PATCH] Fix start-stop-daemon on no-MMU

Alex Landau landau_alex at yahoo.com
Thu Aug 2 11:02:18 UTC 2007


--- Denis Vlasenko <vda.linux at googlemail.com> wrote:

> > > > The child merely execv()s.
> > >
> > > So on NOMMU execv() basically creates another process in another
> > > memory region, and
> > > terminates current one, unless there is a parent sitting in vfork and waiting
> > > (in which case parent is woken up instead of exit)?
> >
> > No, execve works exactly it does on an MMU system. It loads a new executable into the
> > current process.
> 
> ...trashing all memory area occupied by the process? how parent is
> able to run then?

And what about the normal fork and execve? With fork, the text vmas are shared too, and,
I guess, on execve they are unshared. Not sure, but I guess the same happens here. Well,
not the same, since there is a difference between a shared vma and a shared
address_space, but it's the same idea.
Anyway, that's my understanding.

Alx

> 
> > The difference is with vfork: on vfork, the parent is suspended, and the
> > child shares it's whole address space with the parent (the stack is shared too -
> that's
> > why this is so tricky!). The parent is resumed when the child either execve()s or
> > _exit()s.
> 
> I don't understand how parent is able to run if execve just nuked
> parent's text segment
> with unrelated code of execed program.
> --
> vda
> 



       
____________________________________________________________________________________
Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games.
http://sims.yahoo.com/  



More information about the busybox mailing list