Andreas Dilger <adil...@dilger.ca> wrote:

> > POSIX does not require you to call fsync() before you are able to get the
> > expected result from stat()
> > 
> > If POSIX did make such assumptions, it would document then. The fact that
> > there is no related text in POSIX is sufficient to prove what POSIX expects.
>
> I don't agree with your extrapolation at all.  You're saying that everything
> POSIX doesn't document must be forbidden, which is a big stretch.

You seem to missinterpret me.

POSIX requires things to be documented in case there is unexpected behavior.

Returning st_blocks == 0 for a file with at least 512 bytes of data is such 
unexpected behavior.

Returning a value for st_blocks, that changes with the phases of the moon while 
the content of that file is not changed is another unexpected behavior.

BTW: I remember that Sun started with a similar inconsistent approach (for 
statvfs() in this case) ~ 14 years ago, when efficiency for unlink() was 
increaded by implementing a background unlink(). Sun failed to pass the POSIX 
conformance tests with the first approach and had to change the implementation 
to returm more expectable results.

Jörg

-- 
 EMail:jo...@schily.net                    (home) Jörg Schilling D-13353 Berlin
    joerg.schill...@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
 URL: http://cdrecord.org/private/ http://sf.net/projects/schilytools/files/'

Reply via email to