X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,TW_TV X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: References: Date: Fri, 14 May 2010 12:35:25 +0800 Message-ID: Subject: Re: vfork always fail problem From: Huang Bambo To: The Cygwin Mailing List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Finally I test and get another result. I run the test program at /home/Bambo/test/t1/ but /home/Bambo/test is a symbolic link to another directory. Maybe it's the problem that the system handle symbolic 2010/5/14 Huang Bambo : > [Bambo AT bambo-notebook 4.4.4]$ cat tvfork.c > #include > #include > #include > > int main(void) > { > =A0 =A0 =A0 =A0pid_t pid =3D vfork(); > =A0 =A0 =A0 =A0if ( pid > 0 ) > =A0 =A0 =A0 =A0{ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printf("I'm chield.\n"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0_exit(0); > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0else if ( pid =3D=3D 0 ) > =A0 =A0 =A0 =A0{ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printf("I'm parent"); > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0else > =A0 =A0 =A0 =A0{ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0perror("vfork failed."); > =A0 =A0 =A0 =A0} > } > [Bambo AT bambo-notebook 4.4.4]$ make tvfork > cc =A0 =A0 tvfork.c =A0 -o tvfork > [Bambo AT bambo-notebook 4.4.4]$ ./tvfork.exe > =A0 =A0 =A04 [main] tvfork 4136 fork: child -1 - CreateProcessW failed, e= rrno 2 > vfork failed.: No such file or directory > [Bambo AT bambo-notebook 4.4.4]$ ./tvfork > =A0 =A0 =A03 [main] tvfork 2956 fork: child -1 - CreateProcessW failed, e= rrno 2 > vfork failed.: No such file or directory > > I think maybe the wrong parameters were sent while calling CreateProcessW. > -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple