From owner-freebsd-hackers Wed Jun 23 13: 4: 1 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from sol (cs1-gw.cs.binghamton.edu [128.226.171.72]) by hub.freebsd.org (Postfix) with SMTP id F023D1519C for ; Wed, 23 Jun 1999 13:03:46 -0700 (PDT) (envelope-from zzhang@cs.binghamton.edu) Received: from localhost (zzhang@localhost) by sol (SMI-8.6/8.6.9) with SMTP id PAA04481 for ; Wed, 23 Jun 1999 15:51:55 -0400 Date: Wed, 23 Jun 1999 15:51:55 -0400 (EDT) From: Zhihui Zhang To: freebsd-hackers@freebsd.org Subject: Difference between msync() and fsync() Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG After we mmap a file, we can write back the dirty pages of the file either by calling msync() or fsync(). After reading the source code, it seems to me that they actually does the same thing. msync() will eventually call VOP_FSYNC() as fsync() does. Since msync() has already call the routine vm_object_page_clean() to write back the dirty pages of the file, VOP_FSYNC() really does not have much left to do except update the inode. So is there any real differnce between msync() and fsync() on mmapped files? Or are they simply provided to do the same thing in an alternate way? Thanks for any help. -------------------------------------------------- Zhihui Zhang. Please visit http://www.freebsd.org -------------------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message