delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/09/05:07:45

Date: Tue, 9 Mar 1999 12:04:42 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: "Edward F. Sowell" <sowelled AT home DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Weird behavior with spawnl()
In-Reply-To: <36E42806.E16550BF@home.com>
Message-ID: <Pine.SUN.3.91.990309120417.7248N-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 8 Mar 1999, Edward F. Sowell wrote:

> That is, if both buildsolxx.cpp and
> tstCreateProcess.cpp  are compiled/linked with MS VC++ tools, everything
> works as expected. However, if the launched program (buildsolxxx.exe)
> is created with DJGPP compiler/linker (e.g., using rhide),
> there is no error reported from spawnl(), but the process is not
> in fact executed... i.e., the buildsol.log file is not created, etc.

Are you sure the DJGPP program doesn't start at all?  Maybe it just
fails to produce the expected results, for some reason?

What happens if you try to run the program via COMMAND.COM
(e.g. "command.com /c foo.exe")?  Or just call `system' instead of
`spawn'.

I don't know how does `spawn' in MSVC work, it could do something that
fails with DJGPP (or otherwise DOS) programs.

> to spawn a "make" program. If  buildsolver is compiled with MS VC++,
> it will not work, apparently because the command line (in the spawnl()
> arg list) gets chopped at 126 characters.

DJGPP doesn't support the method used by Win32 programs to pass long
command lines.  If you can describe that method in detail, maybe the
DJGPP startup code could be changed to support it.

> int spawnres =  spawnl(P_WAIT, argv[1], argv[1], argv[2],argv[3], NULL);
> if (spawnres != 0) {
>         cout << endl;
> 		perror("Spawn returned an error in buildsolver.");
>       }

This is too complicated, since it involves argv[1] passed from
somewhere else.  I suggest to throw together a simple test program
that calls spawnl with a known constant string, then post the results.

Btw, the error code returned by spawnl is not the only error
indicator; errno is another.

- Raw text -


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