View Single Post
Old 05-29-2009, 05:10 AM   #10
Godzil
a pthread?? where? where?
Godzil can even cheer up an android equipped with a defective Genuine Personality Prototype.Godzil can even cheer up an android equipped with a defective Genuine Personality Prototype.Godzil can even cheer up an android equipped with a defective Genuine Personality Prototype.Godzil can even cheer up an android equipped with a defective Genuine Personality Prototype.Godzil can even cheer up an android equipped with a defective Genuine Personality Prototype.Godzil can even cheer up an android equipped with a defective Genuine Personality Prototype.Godzil can even cheer up an android equipped with a defective Genuine Personality Prototype.Godzil can even cheer up an android equipped with a defective Genuine Personality Prototype.Godzil can even cheer up an android equipped with a defective Genuine Personality Prototype.Godzil can even cheer up an android equipped with a defective Genuine Personality Prototype.Godzil can even cheer up an android equipped with a defective Genuine Personality Prototype.
 
Godzil's Avatar
 
Posts: 1,763
Karma: 30462
Join Date: Mar 2009
Location: Somewhere in EU
Device: Newton MessagePad 2100, and only this
Yes, you have to wait, but sync(1) (not sync(2) because it is not the command line tool, but a C function and they not necessarily work the same way, even if sync(1) may use sync(2)) will not exit until the cache has been flushed.

But yes, using unmount is the best way to do.

(And I'm really sorry for all non Linux speaking person here such a message could be really cryptic )

(and the Linux man page for sync(2) have this information:

Quote:
BUGS
According to the standard specification (e.g., POSIX.1-2001), sync() schedules the writes, but may return before the actual writing is
done. However, since version 1.3.20 Linux does actually wait. (This still does not guarantee data integrity: modern disks have large
caches.)
And flash device does not have such cache.

Last edited by Godzil; 05-29-2009 at 05:15 AM. Reason: edit: add some manpage informations
Godzil is offline   Reply With Quote