Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-02-22 18:30:09 +0300
committerCorinna Vinschen <corinna@vinschen.de>2005-02-22 18:30:09 +0300
commita62f6b806ebe83a6158133084d7ce104e0e2fa62 (patch)
tree8d4227cfc097d1b8a03f29fb6f7199a52385b05a
parent2f707783a28d9231f8c37f1fda74fa470b092b6b (diff)
* 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.
-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 d6adc5af1..08d6fa970 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 6f0acb787..fe4730ed8 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 e4089d64f..70cd4dbad 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 c38fc5520..ecb467f3d 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 d76960829..a80b47090 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)
{