Mail Archives: djgpp/1992/08/28/14:03:23
Since there are so many programs that really want a binary stdin/stdout,
maybe it would be possible to create a second crt0.o that, just before the
call to main, does a call to a function fixIO()
where fixIO() is:
void fixIO(void) {
setmode(fileno(stdion),O_BINARY);
setmode(fileno(stdout),O_BINARY);
}
just add fixIO to libc.a. Whenever you want to do a program that really want
binary i/o, you just link with the alternative crt0.o file.
I suppose fixIO() should do a _fmode = O_BINARY as well.
Any major flaws with this plan???
(The easiest way to choose the crt0.o file would be to have one crt0text.o and
crt0bin.o and copy the appropriate one to crt0.o as necessary). I doubt that
people would be working on simulateous projects that would require switching
back and forth between the crt0.o files often.
Just throwing out ideas,
mrc
- Raw text -