www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/12/13/05:47:28

Date: Mon, 13 Dec 1999 10:43:11 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Juergen Buchmueller <pullmoll AT t-online DOT de>
cc: djgpp-workers AT delorie DOT com, DJ Delorie <dj AT delorie DOT com>
Subject: Re: [pullmoll AT t-online DOT de: libc bug report]
In-Reply-To: <199912130034.TAA03406@envy.delorie.com>
Message-ID: <Pine.SUN.3.91.991213104127.29470U-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Date: Sun, 12 Dec 1999 13:36:02 +0100
> From: pullmoll AT t-online DOT de (Juergen Buchmueller)
> X-Accept-Language: en
> To: dj AT delorie DOT com

Thanks for your report.

> I stumbled across a flaw in DJGPPs implementation of the fopen() libc
> function - specificially the "a" append mode.

It's a known bug: the library currently handles "a" and O_APPEND only
when the file is opened, but it doesn't ``remember'' that information
afterwards.

(Frankly, I'm amazed that it took so long for someone to complain.
AFAIK, this bug exists since DJGPP v2.0 hit the streets; I found out
about it by chance, simply from examining the sources, about half a
year ago.)

> I hope it'll be easy to fix it.

Unfortunately, it isn't.  DOS doesn't have an ``append'' bit in any of
the functions that open/create files.  So this requires to save the
O_APPEND bit in some internal library data structure and use some
non-trivial logic based on that bit to reset the file position before
each write.

Unless some disaster strikes, this should be fixed in v2.04.

- Raw text -


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