This is the mail archive of the cygwin mailing list for the Cygwin 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]

RE: sync(2)


> sync() should flush all open or cached file data and 
> metadata. and volume master blocks.
>

Not according to POSIX:

http://www.opengroup.org/onlinepubs/007908799/xsh/sync.html
"The sync() function causes all information in memory that updates file
systems to be scheduled for writing out to all file systems. The writing,
although scheduled, is not necessarily complete upon return from sync()."

Since all write file operations in memory by definition 'schedule' the
operations to be written out, this means that a no-op sync() is completely
POSIX-compliant (and certainly "efficient"! ;-)).  I don't know if that's
good or bad, and I sure am having a hard time figuring out why it's like
that, but that's the way it is.

> The problem is that I have a simple patch, but this might get 
> tricky if there are more processes involved, which I doubt. I 
> doubt that there such a thing exists and that it will be 
> useful at all.
> We could also just flush all local NTFS volumes, but this 
> would need Administrator privileges

Right.

> (and therefore probably 
> cygserver support).
> 

???... Oh, you mean cygserver running as Admin or SYSTEM or whatever and
doing it for cygwin1.dll.  Yeah, that might work.

-- 
Gary R. Van Sickle
 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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