[uClinux-dev] how to implement vfork()

Phil Wilshire pwilshire at cox.net
Wed Jun 6 08:27:42 EDT 2007


Hi Again Ahan,
I think you will find that this is not really a valid example.
It is infinitely recursive and NOT creating your own argv structure for
the execvp.
In the examples I pointed you to did something different to your example.
They all work just fine and have done so for a long time.
So take a look at simpleinit , inetd and rework your example to use new
argv structures and also make it non infinite.


  Phil


Ahan Hsieh ÁªZº~ wrote:
> 
> Dear Phil,
> 
> I take this simple example:
> 
>     int main(void)
>     {
>         pid_t pid;
>         int status, wpid;
>         if ((pid = vfork()) == 0) {
>             execvp(argv[0], argv);
>             _exit(0);
>         }
>         return EXIT_SUCCESS;
>     }


More information about the uClinux-dev mailing list