Mail Archives: djgpp/2000/08/21/03:17:20
> From: "Tim 'Zastai' Van Holder" <zastai AT hotmail DOT com>
> Newsgroups: comp.os.msdos.djgpp
> Date: Sun, 20 Aug 2000 20:49:49 GMT
>
> The problem seems to be that the program also uses termios calls, so
> __write will just call __libc_termios_write and never use the fsext
> function. Is this how it's supposed to be?
Yes, this is how it works right now: termios effectively disables
FSEXT hooks for a handle, if the handle refers to the console device
(other handles, such as those for disk files, are still passed to
FSEXT hooks).
The reason for this is that termios hooks the I/O ahead of the
low-level library functions which invoke DOS, and where the FSEXT
hooks are invoked. Termios does that because it redirects I/O to BIOS
functions, and it needs to see the exact text sent by the program,
before such transformations as NL->CRLF, for exmple, since termios
offers functions to control that.
> And, if so, how do I get around it? IE how do I prevent the termios
> hooks from being used
Assuming that the program must use termios, the only way out of this
is to change the DJGPP termios emulation so that it, too, supports
FSEXT.
Take a look at the file tminit.c in the library sources, I think it's
not that hard to make it compatible with FSEXT. One issue that needs
to be decided is this: do you want termios emulation active for a
handle hooked by an FSEXT, or do you want to bypass termios completely
(I think the former, since you might want some of the termios
functionality). This will tell you where should tminit.c pass control
to the FSEXT.
- Raw text -