[PATCH] Fix start-stop-daemon on no-MMU
Denis Vlasenko
vda.linux at googlemail.com
Thu Aug 2 10:52:46 PDT 2007
On 8/2/07, Alex Landau <landau_alex at yahoo.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?
That's MMU, and there it's all crystal clear.
I was specifically thinking how our trick is working on _NOMMU_.
Mostly for self-education. So, after execve on NOMMU old process
is not destroyed, but "returned" to parent-after-vfork, and
while parent does something, new process is already has memory
allocated for it?
OIW: at execve, does kernel do something like this?
if (vfork_was_done) {
create_and_start_new_process();
wake_up_parent_in_vfork();
} else {
destroy_current_process();
create_and_start_new_process();
}
--
vda
More information about the busybox
mailing list