aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/cygwin.din1
-rw-r--r--winsup/cygwin/fhandler.cc5
-rw-r--r--winsup/cygwin/include/cygwin/version.h3
-rw-r--r--winsup/cygwin/syscalls.cc2
5 files changed, 18 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index d6adc5a..08d6fa9 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,11 @@
+2005-02-22 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygwin.din (fdatasync): Export.
+ * fhandler.cc (fhandler_base::fsync): Return with EINVAL if no
+ handle is available.
+ * syscalls.cc (fdatasync): Create export alias to fsync.
+ * include/cygwin/version.h: Bump API minor version.
+
2005-02-20 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (fhandler_base::fstat_helper): Declare with additional
diff --git a/winsup/cygwin/cygwin.din b/winsup/cygwin/cygwin.din
index 6f0acb7..fe4730e 100644
--- a/winsup/cygwin/cygwin.din
+++ b/winsup/cygwin/cygwin.din
@@ -562,6 +562,7 @@ _fsetpos64 = fsetpos64 SIGFE
_fstat64 = fstat64 SIGFE
fstatfs SIGFE
_fstatfs = fstatfs SIGFE
+fdatasync SIGFE
fsync SIGFE
_fsync = fsync SIGFE
ftell SIGFE
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index e4089d6..70cd4db 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -1627,6 +1627,11 @@ fhandler_base::utimes (const struct timeval *tvp)
int
fhandler_base::fsync ()
{
+ if (!get_handle () || nohandle ())
+ {
+ set_errno (EINVAL);
+ return -1;
+ }
if (pc.isdir ()) /* Just succeed. */
return 0;
if (FlushFileBuffers (get_handle ()))
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
index c38fc55..ecb467f 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -246,12 +246,13 @@ details. */
116: Export atoll.
117: Export utmpx functions, Return utmp * from pututent.
118: Export getpriority, setpriority.
+ 118: Export fdatasync.
*/
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
#define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 118
+#define CYGWIN_VERSION_API_MINOR 119
/* There is also a compatibity version number associated with the
shared memory regions. It is incremented when incompatible
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index d769608..a80b470 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -918,6 +918,8 @@ fsync (int fd)
return cfd->fsync ();
}
+EXPORT_ALIAS (fsync, fdatasync)
+
static void
sync_worker (const char *vol)
{