www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/06/21/15:03:29

To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: MORE on O_TEXT/O_BINARY
Date: Tue, 21 Jun 1994 11:33:00 PDT
From: "Marty Leisner" <leisner AT sdsp DOT mc DOT xerox DOT com>

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019