Date: Tue, 28 Oct 1997 10:49:54 +0200 (IST) From: Eli Zaretskii To: Nate Eldredge cc: djgpp AT delorie DOT com Subject: Re: Stuff about sync() In-Reply-To: <199710280112.RAA17389@adit.ap.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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? Thanks.