dealing with close() errors

Greg Hunt hunt at dg-rtp.rtp.dg.com
Wed Oct 31 02:38:32 AEST 1990


In article <1990Oct29.202811.9409 at athena.mit.edu>, jik at athena.mit.edu
(Jonathan I. Kamens) writes:
> 
>   The semantics of fsync() are not clear when discussing remote
filesystems,
> i.e. it isn't clear for some filesystem types exactly what fsync()
"should"
> do
> and what it does in reality.
> 

You're right.  I forgot to mention in my original article that my
perspective is how the Data General DG/UX "fsync" system call works.
I don't know how other systems handle it.

>   Also, what happens if fsync() fails?  Is the file descriptor valid,
and is
> all of the data still available in the file, even though the file
could not
> be
> pushed to disk?  I don't know about this, which is why I'm asking....
if
> fsync() will cause the kernel to throw away any data that it can't
save to
> the
> disk, then my suggestion to create another system call that would
notify you
> on success *and not throw away data* on failure is still pertinent.

I'm not 100% certain, but from reading the DG/UX man page on fsync,
there is a clear (to me) implication that when an fsync fails the
file descriptor remains open and valid, and the data remains buffered
in the system.  If this isn't the way it works in reality, then I would
also want the new system call that you propose.

--
Greg Hunt                        Internet: hunt at dg-rtp.rtp.dg.com
DG/UX Kernel Development         UUCP:     {world}!mcnc!rti!dg-rtp!hunt
Data General Corporation
Research Triangle Park, NC       These opinions are mine, not DG's.



More information about the Comp.unix.internals mailing list