Date: Tue, 28 Jul 1998 10:47:42 +0300 (IDT) From: Eli Zaretskii To: "Salvador Eduardo Tropea (SET)" cc: djgpp-workers AT delorie DOT com Subject: Re: Pipes In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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).