From 4944ca2f090de13e5afbde071def7449b25dcfd5 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sun, 20 Feb 2005 13:28:23 +0000 Subject: * autoload.cc (FindFirstVolumeA): Add. (FindNextVolumeA): Add. (FindVolumeClose): Add. (GetVolumePathNamesForVolumeNameA): Add. * fhandler.h (class fhandler_base): Declare new method fsync. * fhandler.cc (fhandler_base::fsync): New method. * syscalls.cc (fsync): Move functionality into fhandler method fsync. Just call this method from here. (sync_worker): New static function. (sync): Fill with life for NT systems. * wincap.h (wincaps::has_guid_volumes): New element. * wincap.cc: Implement above element throughout. --- winsup/cygwin/fhandler.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'winsup/cygwin/fhandler.cc') diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 6a935fbec..e4089d64f 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -1623,3 +1623,14 @@ fhandler_base::utimes (const struct timeval *tvp) set_errno (EINVAL); return -1; } + +int +fhandler_base::fsync () +{ + if (pc.isdir ()) /* Just succeed. */ + return 0; + if (FlushFileBuffers (get_handle ())) + return 0; + __seterrno (); + return -1; +} -- cgit v1.2.3