This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC] fdopen("a"), O_APPEND and active handles


Hi,

So while thinking over the third iteration of this fix, it occurred to
be that even the act of adding O_APPEND to a file descriptor through
fdopen will change the way subsequent write() calls behave, since they
will suddenly start appending to the file instead of writing at the
current location.  Given the fact that a handle's effect should not
come into effect till it performs its first offset modifying act
(i.e. fseek, read, write, etc.), this behaviour seems to be in
violation of that expectation.

This would mean that an fdopen should not directly result in a call to
O_APPEND.  Instead, it should record the result of the open somewhere
and on first read/write/seek, call fcntl and then perform that action.
Is this interpretation correct or is there something else in the
standard that allows fdopen to set O_APPEND right away?  I know that
the fdopen specification rationale says that a good specification sets
O_APPEND, but it doesn't really specify when.

Siddhesh

Attachment: pgpBuenhnBisM.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]