Mail Archives: djgpp/2000/02/13/04:29:09
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.
- Raw text -