delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/05/14/01:04:03

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=0.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MIME_CHARSET_FARAWAY,RCVD_IN_DNSWL_NONE,TW_TV
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <AANLkTilNwIZmrLN2cbv99GptZ-xC-LzHMI1_ZXwRAzqE@mail.gmail.com>
References: <AANLkTik_jo0N1YtUTFLzsqAsv5OkkyjCG9epeMq55bWk AT mail DOT gmail DOT com> <AANLkTilNwIZmrLN2cbv99GptZ-xC-LzHMI1_ZXwRAzqE AT mail DOT gmail DOT com>
Date: Fri, 14 May 2010 13:03:39 +0800
Message-ID: <AANLkTilUKgXa1n8NxQ2pQ3utfsNdpPx_E3if-Y39h4dY@mail.gmail.com>
Subject: Re: vfork always fail problem
From: Huang Bambo <bambo DOT huang AT gmail DOT com>
To: The Cygwin Mailing List <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

I truly find the problem.
The path to the executable have Chinese character.
My windows's default language is gbk.
If I use utf-8 encoding for the shell, fork fail. If i use gbk, everything
goes fine.
The following is the test .

[Bambo AT bambo-notebook ARM9]$ pwd
/cygdrive/d/=B8=F6=C8=CB=D1=D0=B7=A2/ARM9
                  ^^^^^^^^^^ Chinese directory name

[Bambo AT bambo-notebook ARM9]$ export LANG=3Den_US.UTF-8
[Bambo AT bambo-notebook ARM9]$ ./tvfork.exe
      3 [main] tvfork 4900 fork: child -1 - CreateProcessW failed, errno 2
vfork failed.: No such file or directory
[Bambo AT bambo-notebook ARM9]$ export LANG=3Den_US.GBK
[Bambo AT bambo-notebook ARM9]$ ./tvfork.exe
I'm parentI'm chield.


2010/5/14 Huang Bambo <bambo DOT huang AT gmail 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 DOT huang AT gmail DOT com>:
>> [Bambo AT bambo-notebook 4.4.4]$ cat tvfork.c
>> #include <sys/types.h>
>> #include <unistd.h>
>> #include <stdio.h>
>>
>> int main(void)
>> {
>>        pid_t pid =3D vfork();
>>        if ( pid > 0 )
>>        {
>>                printf("I'm chield.\n");
>>                _exit(0);
>>        }
>>        else if ( pid =3D=3D 0 )
>>        {
>>                printf("I'm parent");
>>        }
>>        else
>>        {
>>                perror("vfork failed.");
>>        }
>> }
>> [Bambo AT bambo-notebook 4.4.4]$ make tvfork
>> cc     tvfork.c   -o tvfork
>> [Bambo AT bambo-notebook 4.4.4]$ ./tvfork.exe
>>      4 [main] tvfork 4136 fork: child -1 - CreateProcessW failed, errno 2
>> vfork failed.: No such file or directory
>> [Bambo AT bambo-notebook 4.4.4]$ ./tvfork
>>      3 [main] tvfork 2956 fork: child -1 - CreateProcessW failed, errno 2
>> vfork failed.: No such file or directory
>>
>> I think maybe the wrong parameters were sent while calling CreateProcess=
W.
>>
>

--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019