www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/02/19/02:03:57

From: sos AT prospect DOT com DOT ru (Sergey Okhapkin)
Subject: RE: The alleged newlib/libc/stdio/fdopen.c bug
19 Feb 1998 02:03:57 -0800 :
Message-ID: <01BD3D21.973CA0F0.cygnus.cygwin32.developers@gater.krystalbank.msk.ru>
To: "'Ian Lance Taylor'" <ian AT cygnus DOT com>
Cc: "'cygwin32-developers AT cygnus DOT com'" <cygwin32-developers AT cygnus DOT com>

Ian Lance Taylor wrote:
>    > I'm not sure. When O_APPEND is set, we have to seek to end of file 
on
>    > fdopen() call. When __SAPP is set, _every_ write call seeks to eof 
before
>    > write! Is it a correct behavior for O_APPEND? BTW, where fdflags 
variable
>    > is defined?
>
> That is correct for O_APPEND: every write should go to the end of the
> file, wherever the end of the file happens to be at that time.  For
> example, on Unix this can be used for writing log files from several
> processes; provided each write is done in a single call, if you use
> O_APPEND then you know that none of the writes will clobber another.
>
> The patch looks OK to me.

This behavior doesn't works with gnu CSSC. The code makes fdopen(fd, 
O_APPEND), writes some lines to the end of file, seeks to the beginning of 
file and writes new file header. With this patch new file header will be 
written to the end of file!

--
Sergey Okhapkin, http://www.lexa.ru/sos
Moscow, Russia
Looking for a job.


- Raw text -


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