Mail Archives: djgpp/1997/10/28/03:50:12
On Mon, 27 Oct 1997, Nate Eldredge wrote:
> 1. sync() seems to be poorly documented. The docs just say it's to assist
> porting Unix programs and always returns zero. It doesn't say that it calls
> fsync() for every open file, which it does.
Right. Explaining what exactly does calling `fsync' achieve on DOS
would also be nice.
> 2. IMHO, sync() should call _flush_disk_cache() in order to be closer to its
> Unix behavior.
Careful. `_flush_disk_cache' has some side-effects that are NOT
produced by `sync' system call on Unix. For example, most disk caches
(actually, all of them that I saw) will entirely forget the previous
data, so e.g. they will read the floppy disk again after the call,
even though the same floppy was read before the call. In contrast,
`sync' on Unix does nothing to the disk cache contents, AFAIK.
But on balance, I agree that calling `_flush_disk_cache' from `sync'
is a good idea.
Could you please make these changes and submit them to DJ Delorie?
- Raw text -