You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by st...@apache.org on 2009/07/11 18:11:29 UTC

svn commit: r793192 - in /apr/apr/trunk: configure.in file_io/unix/readwrite.c

Author: striker
Date: Sat Jul 11 16:11:29 2009
New Revision: 793192

URL: http://svn.apache.org/viewvc?rev=793192&view=rev
Log:
Link again on OS X, where fdatasync() does not seem to exist.

* configure.in
  Add check for fdatasync.
* file_io/unix/readwrite.c
  (apr_file_datasync): Use fsync when fdatasync is not available.

Modified:
    apr/apr/trunk/configure.in
    apr/apr/trunk/file_io/unix/readwrite.c

Modified: apr/apr/trunk/configure.in
URL: http://svn.apache.org/viewvc/apr/apr/trunk/configure.in?rev=793192&r1=793191&r2=793192&view=diff
==============================================================================
--- apr/apr/trunk/configure.in (original)
+++ apr/apr/trunk/configure.in Sat Jul 11 16:11:29 2009
@@ -799,7 +799,7 @@
 fi
 
 dnl ----------------------------- Checking for extended file descriptor handling
-AC_CHECK_FUNCS(dup3 accept4 epoll_create1)
+AC_CHECK_FUNCS(dup3 accept4 epoll_create1 fdatasync)
 
 AC_CACHE_CHECK([for SOCK_CLOEXEC support], [apr_cv_sock_cloexec],
 [AC_TRY_RUN([

Modified: apr/apr/trunk/file_io/unix/readwrite.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/unix/readwrite.c?rev=793192&r1=793191&r2=793192&view=diff
==============================================================================
--- apr/apr/trunk/file_io/unix/readwrite.c (original)
+++ apr/apr/trunk/file_io/unix/readwrite.c Sat Jul 11 16:11:29 2009
@@ -381,7 +381,11 @@
         }
     }
 
+#ifdef HAVE_FDATASYNC
     if (fdatasync(thefile->filedes)) {
+#else
+    if (fsync(thefile->filedes)) {
+#endif
         rv = apr_get_os_error();
     }
 



Re: svn commit: r793192 - in /apr/apr/trunk: configure.in file_io/unix/readwrite.c

Posted by Bojan Smojver <bo...@rexursive.com>.
On Sat, 2009-07-11 at 16:11 +0000, striker@apache.org wrote:
> Link again on OS X, where fdatasync() does not seem to exist.

Thanks for picking that up (I don't have OS X). If we do want to make
all these calls work tighter on OS X, we can also apply F_FULLFSYNC, as
per:

http://developer.apple.com/documentation/Darwin/Reference/ManPages/man2/fsync.2.html
http://developer.apple.com/documentation/Darwin/Reference/ManPages/man2/fcntl.2.html

I think I read somewhere that MySQL does such things.

-- 
Bojan