Date: Sun, 13 Feb 2000 09:45:55 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Rolf Campbell cc: djgpp AT delorie DOT com Subject: Re: How Do I start another DOS program from DJGPP ? In-Reply-To: <38A32674.A12A521E@americasm01.nt.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, 10 Feb 2000, Rolf Campbell wrote: > Eli Zaretskii wrote: > > > > int_handler > > > { > > > read_last_string_from_file("tempfile.txt"); > > > process_that_string_quickly_since_we_are_in_an_interrupt; > > > } > > > > That won't work (or, rather, will crash your system): you cannot safely > > make DOS calls from a hardware interrupt handler, and reading from a file > > requires a DOS call. > > But isn't the DJGPP timer interrupt really delayed until data is > acessed, and then called from the page-fault handler? You are mixing two things: the DJGPP signal handlers and hardware interrupt handlers. Signal handlers indeed run in a safe state, just like the rest of the application code, so you can do anything from them, including DOS file I/O. However, when a program calls DOS, signals are deferred until that call returns. Since spawning a child program requires a DOS call, the parent program will not get any signals until the child program exits. For this reason, I assumed that the original poster was talking about a real hardware interrupt handler, not a signal handler. And DOS file I/O cannot be done from a hardware interrupt handler.