delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/28/03:50:12

Date: Tue, 28 Oct 1997 10:49:54 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Nate Eldredge <eldredge AT ap DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: Stuff about sync()
In-Reply-To: <199710280112.RAA17389@adit.ap.net>
Message-ID: <Pine.SUN.3.91.971028104930.22947O-100000@is>
MIME-Version: 1.0

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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019