www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/04/02:19:21

Date: Sun, 4 Aug 1996 09:12:37 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Nissim Chudnoff <nchudnof AT mbhs DOT edu>, DJ Delorie <dj AT delorie DOT com>
Cc: DJGPP Questions <djgpp AT delorie DOT com>
Subject: Re: more spawnl(
In-Reply-To: <Pine.LNX.3.93.960801170954.9885A-100000@binx.mbhs.edu>
Message-Id: <Pine.SUN.3.91.960804091015.9460G-100000@is>
Mime-Version: 1.0

On Thu, 1 Aug 1996, Nissim Chudnoff wrote:

> Could anyone give me an example of spawnl()'s use? I can't seem to get it
> to do anything, even though I have succesfully compiled some test prgms
> using it...

The example in the libc reference is correct, except that it leaves out 
the first argument:

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

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

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

The last line should have said this:

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

- Raw text -


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