[uClinux-dev] A strange problem of vfork

SuCC sujz at cad.csie.ncku.edu.tw
Thu Nov 15 22:59:21 EST 2001

   I encounter a strange situation about using vfork() in uClinux-2.4.0 on ARM7!!
   We know the return values of vfork() are :
         0      : child process
        -1      : vfork error , and errno will fill a error type
        other : parent process 

   But I have a program(pptp server) which will call vfork like
    pid = vfork();
    if(pid == 0) printf("I am child!!");
    else if(pid == -1) printf("errno=%d",errno);
    else printf("I am parent!!");

    When I run the program.....the result is only show
    "I am parent"

    I have never seen "I am child" if vfork success or "errno = XX" if vfork is failed!!

    Does anyone have the same problem like this.....what's wrong???

     PS. I have tried another little program and vfork() is work ....this surprise me!!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.uclinux.org/pipermail/uclinux-dev/attachments/20011116/6ff08486/attachment.html>

More information about the uClinux-dev mailing list