delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/01/15/06:08:43

Date: Thu, 15 Jan 1998 13:05:46 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Robert Hoehne <robert DOT hoehne AT gmx DOT net>
cc: djgpp-workers AT delorie DOT com
Subject: Re: spawn() problem
In-Reply-To: <34BD2B38.8F094DF5@gmx.net>
Message-ID: <Pine.SUN.3.91.980115130529.12130H-100000@is>
MIME-Version: 1.0

On Wed, 14 Jan 1998, Robert Hoehne wrote:

> Is it a bug or a feature of the spawn... functions, that
> the called DJGPP program ignores the argv0 value of the
> stub? (when spawn.. is called directly and not through
> system() )?

I think `system' should have the same behavior, since it really calls
`spawn' internally.

Anyway, this was discussed during v2.01 development, but it was
decided to leave it alone as it was (since v1.x).  Part of the reason
is that the startup code is tricky and needed a lot of iterations to
get right, and God knows what would break if we change this.

IMHO, the argv0 feature of the stub should not be used.  If you want
to have `foo' instead of `foo.exe' to have `main' decide what to do,
you need to find the extension and strip it off.  There's no easy way
out of this mess.  _CRT0_FLAG_DROP_EXE_SUFFIX also doesn't work from
`spawn', btw.

> I ask this also, so that I will include in the bnu281b.zip
> which I have to upload to DJ (because of the missing
> nm.exe :-( ) again the full executables ranlib.exe and
> strip.exe and not only links to ar.exe and objcopy.exe.

I think adding code which strips the .exe extension is the correct way
to go.  Putting a 200KB-large executable into an archive just to save
a few source lines is IMHO not the best solution.

- Raw text -


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