delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/10/04:51:46

Date: Sun, 10 May 1998 11:48:53 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: leetonks AT hotmail DOT com
cc: djgpp AT delorie DOT com
Subject: Re: DJGPP 2.01 spawnvp problem......
In-Reply-To: <6iud0u$h33$1@nnrp1.dejanews.com>
Message-ID: <Pine.SUN.3.91.980510114832.16214B-100000@is>
MIME-Version: 1.0

On Fri, 8 May 1998 leetonks AT hotmail DOT com wrote:

> > Did you remember to make prog the first element of par as well?  This is
> > by far the most frequent problem with using spawnXX functions.
> 
> I did, yes. Although I didn't at first - it was never mentioned in the info
> for the spawn series of commands

Are you sure you don't use some ancient version of the libc reference?
The file libc.inf from DJGPP v2.01 release says this under "spawn*":

   Description
   -----------

   These functions run other programs.  The PATH points to the program to
   run.  The extension is optional--if not given, and PATH is not found
   neither in the current directly nor along the `PATH', the extensions
   `.com', `.exe', `.bat', `.btm', `.sh', and `.ksh' are checked.

And then the Example section has this:

   char *environ[] = {
     "PATH=c:\\dos;c:\\djgpp;c:\\usr\\local\\bin",
     "DJGPP=c:/djgpp",
     0
   };

   char *args[] = {
     "gcc",
     "-v",
     "hello.c",
     0
   };

   spawnvpe(P_WAIT, "gcc", args, environ);

Which both shows that "gcc" should be passed in the second argument,
and that the args[] array should be NULL-terminated.  The text also
says that the list of arguments should be terminated by a zero.  So
the docs seems to be okay here.

> Again, this isn't mentioned in the docs. Any other shortcomings I should know
> about? ;-)

Well, I don't even see these shortcomings in the last version of the
documentation ;-).

- Raw text -


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