Mail Archives: cygwin-developers/1998/02/18/22:01:35
From: Geoffrey Noer <noer AT cygnus DOT com>
Date: Wed, 18 Feb 1998 17:07:54 -0800 (PST)
Sergey Okhapkin wrote:
>
> Geoffrey Noer wrote:
> > Ian suggests the following:
> >
> > if ((oflags & O_APPEND)
> > #ifdef F_GETFL
> > && !(fdflags & O_APPEND)
> > #endif
> > )
> > fp->_flags |= __SAPP;
> >
> > Look right?
>
> 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.
Ian
- Raw text -