www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/07/28/03:47:44

Date: Tue, 28 Jul 1998 10:47:42 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT gov DOT ar>
cc: djgpp-workers AT delorie DOT com
Subject: Re: Pipes
In-Reply-To: <m0z0pnZ-000S4oC@inti.gov.ar>
Message-ID: <Pine.SUN.3.91.980728104720.4133F-100000@is>
MIME-Version: 1.0

On Mon, 27 Jul 1998, Salvador Eduardo Tropea (SET) wrote:

> > How about calling setjmp before spawn and then longjmp there from the 
> > code that is invoked when the child e.g. calls Int 31h?
> 
> Even when what you say is wrong (could leak memory if it is allocated by 
> spawn)

Which memory is that?  dosexec.c only allocates a small (34-byte)
buffer for the " !proxy" environment variable.  If you modify
dosexec.c to setjmp around the call to __dpmi_int that invokes the DOS
Exec function, you can return there and deallocate that buffer.

Or are you talking about the stack?

> I'm not switching the PSP and the only file I'm using is stdout to print. So 
> that isn't the problem. Something fails when spawn is called twice. I'll try 
> longjmping inside spawn to avoid it.

I would suggest to switch PSP nevertheless.  DOS uses the PSP to make
various decisions about which program is running, and may become
confused if you don't switch them.  For example, calling Int 21h
function 4Ch when the PSP is set to that of the child program makes
DOS think that the child is exiting (this is actually a well-known way
of forcefully aborting a runaway program: set PSP to its PSP and call
function 4Ch).

- Raw text -


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