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" Sender: halo1 AT zahav DOT net DOT il To: djgpp AT delorie DOT com Message-ID: <01c4ffd7$Blat.v2.4$39884560@zahav.net.il> Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=ISO-8859-1 X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 2.4 In-reply-to: (one2001boy AT yahoo DOT com) Subject: Re: ls.exe in execv References: 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 Precedence: bulk > From: "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 > #include > 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 ") works for me.