Mail Archives: djgpp-workers/2001/02/17/13:33:42
> From: "Mark E." <snowball3 AT bigfoot DOT com>
> Date: Fri, 16 Feb 2001 18:33:10 -0500
>
> The only flaw I see is if
> the file is opened first without O_TEMPORARY, the second open with
> O_TEMPORARY won't be able to find out about the first one.
>
> Ideas on what to do here and why are definitely welcome.
After spending some time thinking about this and playing with several
ideas, I came to a conclusion that the simplest way is the best. That
is, simply record each open file in the per-handle array that you
invented for the O_TEMPORARY feature, even if it is not open with
O_TEMPORARY. You will have to flag the ``normal'' (non-temporary)
handles in some way, so that a call to _close won't remove them unless
the same file is later open with O_TEMPORARY. When a file is open
with O_TEMPORARY, search for the same file name in the array of
recorded handles, and if you find the name, treat it as a call to
`dup'.
Another issue related to this is what about the files that are opened
with O_TEMPORARY, but not explicitly closed before the program exits.
I guess we will need to make an exit hook along the lines of the hook
in stdiohk.c, which is called by the exit code.
- Raw text -