Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: Eli Zaretskii , djgpp-workers AT delorie DOT com Date: Tue, 28 Jul 1998 09:54:52 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Pipes References: In-reply-to: Precedence: bulk Eli Zaretskii wrote: > 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 just saw a free call. And is outside the main function. I don't care about stack if I'll use longjmps. > > 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). Ok, I'll add it to the experiments. SET ------------------------------------ 0 -------------------------------- Visit my home page: http://set-soft.home.ml.org/ or http://www.geocities.com/SiliconValley/Vista/6552/ Salvador Eduardo Tropea (SET). (Electronics Engineer) Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org ICQ: 2951574 Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA TE: +(541) 759 0013