delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2005/01/21/11:38:49

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: Fri, 21 Jan 2005 18:34:29 +0200
From: "Eli Zaretskii" <eliz AT gnu DOT org>
Sender: halo1 AT zahav DOT net DOT il
To: djgpp AT delorie DOT com
Message-ID: <01c4ffd7$Blat.v2.4$39884560@zahav.net.il>
X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 2.4
In-reply-to: <Id3Id.13792$5R.2943@newssvr21.news.prodigy.com>
(one2001boy AT yahoo DOT com)
Subject: Re: ls.exe in execv
References: <Id3Id.13792$5R DOT 2943 AT newssvr21 DOT news DOT prodigy DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: "one2001boy AT yahoo DOT com" <one2001boy AT yahoo DOT com>
> Date: Fri, 21 Jan 2005 08:40:08 GMT
> 
> In windows,
> 
> does anybody know if there is a solution for not hanging when run 
> execv()? it seems that running notepad.exe is fine, however, running 
> "ls.exe" compiled with djgpp will hangup the application. Here is the 
> the sample code.
> 
> #include <windows.h>
> #include <stdio.h>
> int main() {
>      char ** environ=_environ;/**** SYSTEM DEFINED ENVIRONMENT POINTER */
>      int retval;
> 
>      /* this is OK
>      char *argv[] = {"C:\\WINDOWS\\SYSTEM32\\notepad.exe", NULL};
>      retval = execv("C:\\WINDOWS\\SYSTEM32\\notepad.exe",  argv);
>      */
> 
>      /*  this will hang
>      */
>      char *argv[] = {"C:\\bin\\ls.exe", "C:\\", NULL};
>      retval = execv("C:\\bin\\ls.exe",  argv);

With what compiler did you compile this?  DJGPP doesn't have a
windows.h header, so it must be some other compiler, in which case the
problem must be in that other compiler or its associated libraries,
since the same program (without "#include <windows.h>") works for me.

- Raw text -


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