delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/08/21/02:43:18

Date: Mon, 21 Aug 2000 09:43:38 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: lauras AT softhome DOT net
Message-Id: <9003-Mon21Aug2000094337+0300-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.2.emacs20_6 I) and Blat ver 1.8.5b
CC: djgpp-workers AT delorie DOT com
In-reply-to: <39A0252F.D9DB130A@softhome.net> (message from Laurynas Biveinis
on Sun, 20 Aug 2000 20:36:31 +0200)
Subject: Re: Symlink support in dosexec.c
References: <39A0252F DOT D9DB130A AT softhome DOT net>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Date: Sun, 20 Aug 2000 20:36:31 +0200
> From: Laurynas Biveinis <lauras AT softhome DOT net>
> 
> I've following little problem:
> should this code pass argv[0] as 'args.exe'?
> 
>    symlink("args.exe", "linkargs.exe");
>    spawnl(P_WAIT, "linkargs.exe", "args.exe", "oh", "well", NULL);

It should, but it can't, in general.

> If yes, (I assumed that), then the following code in go32_exec() worries me:
> 
>   save_argv0 = argv[0];
>   argv[0] = unconst(program, char *); /* since that's where we really found it */
> 
> Could anyone put some light on this?

This is documented on spawn's Info page: DOS cannot pass argv0
separately, so the third argument to spawnl is generally ignored.

We could have arranged to pass the correct argv0 when we invoke
programs the DJGPP way (via !proxy), but that would create subtle
differences with the case when a program is invoked via the shell, or
by `system'.  So we leave this alone.

FWIW, I've never seen code which uses the possibility of passing argv0
which is different from the program's basename.

- Raw text -


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