Subj : Re: reentrant fwrite/fputc/etc ? To : borland.public.cpp.borlandcpp From : gary Date : Fri Nov 14 2003 01:55 pm Ed: thanks. yes, i am already stack switching to avoid blowing a low-level OS/BIOS stack. i've done the whole full-blown "InDOS" flag bit before, with complete DOS context switching, but this particular problem doesn't call for that kind of overhead (nor could it survive it, frankly). i really just needed to dump some serial data to a file during testing and didn't want to hang a "monitor" PC off the side of my serial link. was looking for a quick-and-dirty way to do this with fwrite() or fputc(). in the absense of a safe way to do this with low ISR overhead, i will probably just dump the data to a buffer in the ISR and then put a test in the foreground loop that writes the buffer out to disk when there is something there to dump. Ed Mulroy [TeamB] wrote: > No function which makes a call to DOS is stable for use in an ISR unless > specific, non-trivial efforts are made within the ISR itself to arrange for > the DOS call to work. All of the FILE* I/O functions and most if not all of > the other file I/O functions (including the ones which write as a file to > stdout or stderr) use DOS calls. > > If you need to do that I suggest that you get a book such as "Undocumented > DOS" and use the INDOS flag, an ISR reentrancy flag and stack switching to > arrange that it works. > > . Ed > > >>gary wrote in message >>news:3FB517F7.2040506@cordelli.net... >> >>this is why you need to be careful what C lib functions you >>call inside an ISR. >> > > .