Hi Ahan,

Sorry to state the obvious but limit what you do in the child process before calling execve.

You can run the same code as the parent using execve and identify it as a child process by setting some options in its arg list. You have control over both the arg list and the environment for the new child process.

Take a look at some examples in
simpleinit and inetd

Regards
  Phil Wilshire

Ahan Hsieh 謝武漢 wrote:

Hi folk,

I'm porting uClinux to our new no-mmu architecture.
There is a trouble occured.

After system call vfork() is called, the parent is suspended and
cannot continue executing until the child exits or calls exec(),
the system call used to start a new application.
The child, directly after returning from vfork(),
is running on the parent's stack and is using the parent's memory and data.
This means the child can corrupt the data structures or the stack in the parent, resulting in failure.

How can I avoid the problem? Is there any solution?

Thanks!

Best regards,
Ahan Hsieh


------------------------------------------------------------------------

_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to