Mail Archives: djgpp/1993/12/07/11:11:53
> #include <stdlib.h>
> void main(int argc, char *argv[])
> {
> execv("DOIT.EXE", argv[]); /* or another flavor of exec() */
> }
>
> DOIT.EXE will see that argv[0] = "DODAT.EXE", won't it? This seems to
No. argv[0] is *always* set from the program name in MS-DOS,
regardless of what you pass for exec*. DJGPP bypasses MS-DOS in order
to provide this functionality, so if you were using a djgpp program to
call another djgpp program (via exec*), the argv array is passed
intact. Note, however, that it's much more efficient to use the
symbolic link mechanism that djgpp provides instead.
- Raw text -