delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/12/07/11:11:53

Date: Tue, 7 Dec 93 10:43:24 -0500
From: DJ Delorie <dj AT ctron DOT com>
To: flaregun AT strauss DOT udel DOT edu
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Symbolic links and functionality [ was: O_BINARY ]

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


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