www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/05/09/13:36:21

Mime-Version: 1.0
To: djgpp-workers AT delorie DOT com
From: Nate Eldredge <nate AT cartsys DOT com>
Subject: Re: DJGPP 2.01 spawnvp problem......
Date: Sat, 9 May 1998 10:29:52 -0700
Message-ID: <19980509172947.AAC16984@ppp105.cartsys.com>

--=====================_894735171==_
Content-Type: text/plain; charset="us-ascii"

At 07:42  5/8/1998 GMT, leetonks AT hotmail DOT com wrote:
>In article <Pine DOT SUN DOT 3 DOT 91 DOT 980507164610 DOT 6703D-100000 AT is>,
>  Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:
>>
>>
>> On Thu, 7 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 and I only happened upon the information
>while looking for clues as to why it wasn't working. It didn't help. :-(
>
>
>> par[0] should be the same string as prog, or it won't work.  Also, the
>> last member of par[] should be a NULL pointer.
>
>And that was the problem! I didn't know I should be passing a NULL pointer at
>the end of the args list - the code works perfectly now. THANKS!
>
>Again, this isn't mentioned in the docs. Any other shortcomings I should know
>about? ;-)

The poster has a point here. Fix to the docs is attached (relative to that
from alpha-980101).


--=====================_894735171==_
Content-Type: text/plain; charset="us-ascii"

*** src/libc/dos/process/dosexec.tx~	Fri Jan  2 04:10:08 1998
--- src/libc/dos/process/dosexec.txh	Sat May  9 09:45:06 1998
***************
*** 55,67 ****
  shell with the built-in command as its argument.
  
  The programs are invoked with the arguments given.  The zeroth argument
! is normally not used, since MS-DOS cannot pass it separately.  There are
  two ways of passing arguments.  The @code{l} functions (like
! @code{spawnl}) take a list of arguments, with a zero at the end of the
  list.  This is useful when you know how many argument there will be
  ahead of time.  The @code{v} functions (like @code{spawnv}) take a
! pointer to a list of arguments.  This is useful when you need to compute
! the number of arguments at runtime. 
  
  In either case, you may also specify @code{e} to indicate that you will
  be giving an explicit environment, else the current environment is used. 
--- 55,68 ----
  shell with the built-in command as its argument.
  
  The programs are invoked with the arguments given.  The zeroth argument
! is normally not used, since MS-DOS cannot pass it separately, but for
! compatibility it should be the name of the program.  There are
  two ways of passing arguments.  The @code{l} functions (like
! @code{spawnl}) take a list of arguments, with a @code{NULL} at the end of the
  list.  This is useful when you know how many argument there will be
  ahead of time.  The @code{v} functions (like @code{spawnv}) take a
! pointer to a list of arguments, which also must be @code{NULL}-terminated.  
! This is useful when you need to compute the number of arguments at runtime. 
  
  In either case, you may also specify @code{e} to indicate that you will
  be giving an explicit environment, else the current environment is used. 

--=====================_894735171==_
Content-Type: text/plain; charset="us-ascii"


Nate Eldredge
nate AT cartsys DOT com



--=====================_894735171==_--

- Raw text -


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