Mail Archives: djgpp/2005/01/21/11:38:49
> 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 -