Mail Archives: djgpp/1994/06/21/15:03:29
Well, I've learned"
fopen("b") is ANSI
open(O_BINARY) is not POSIX...
Recompiling the gnu fileutils, I needed to stick this
in the fileutils lib (or else have to change every open call
everywhere or change __fmode in each main...):
.data
.globl __fmode
__fmode:
-> .long 0x000 ; changes from O_TEXTMODE
.text
.globl _open
_open:
testl $0xc000,8(%esp)
jnz L0
andl $0xc000,__fmode
movl __fmode,%eax
orl %eax,8(%esp)
L0:
movb $2,%al
jmp turbo_assist
I really think the default mode should be binary "unless you need to
do something special".
marty
Member of the League of Programming Freedom
leisner AT sdsp DOT mc DOT xerox DOT com leisner AT eso DOT mc DOT xerox DOT com
- Raw text -