/ Check-in [a3315627]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Rig the unix backend to use fdatasync() by default, without having to set the HAVE_FDATASYNC macro. Systems that do not support fdatasync() can be compiled using -Dfdatasync=fsync. (CVS 6368)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:a331562727be465874a66c2c1d15ee070f96f7e0
User & Date: drh 2009-03-21 14:56:52
Context
2009-03-21
16:19
Update comments in build.c to conform to the latest implementation. (CVS 6369) check-in: a915e8e0 user: drh tags: trunk
14:56
Rig the unix backend to use fdatasync() by default, without having to set the HAVE_FDATASYNC macro. Systems that do not support fdatasync() can be compiled using -Dfdatasync=fsync. (CVS 6368) check-in: a3315627 user: drh tags: trunk
14:41
On unix, always use fdatasync() instead of fsync() when available, even if the file size changes, since (we are told) fdatasync() will automatically flush the inode when the file size changes. (CVS 6367) check-in: 0d6b11bc user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

    39     39   **   *  Definitions of sqlite3_io_methods objects for all locking
    40     40   **      methods plus "finder" functions for each locking method.
    41     41   **   *  sqlite3_vfs method implementations.
    42     42   **   *  Locking primitives for the proxy uber-locking-method. (MacOSX only)
    43     43   **   *  Definitions of sqlite3_vfs objects for all locking methods
    44     44   **      plus implementations of sqlite3_os_init() and sqlite3_os_end().
    45     45   **
    46         -** $Id: os_unix.c,v 1.243 2009/03/21 14:41:04 drh Exp $
           46  +** $Id: os_unix.c,v 1.244 2009/03/21 14:56:52 drh Exp $
    47     47   */
    48     48   #include "sqliteInt.h"
    49     49   #if SQLITE_OS_UNIX              /* This file is used on unix only */
    50     50   
    51     51   /*
    52     52   ** There are various methods for file locking used for concurrency
    53     53   ** control:
................................................................................
  2820   2820   ** that syncs and fullsyncs are occurring at the right times.
  2821   2821   */
  2822   2822   int sqlite3_sync_count = 0;
  2823   2823   int sqlite3_fullsync_count = 0;
  2824   2824   #endif
  2825   2825   
  2826   2826   /*
  2827         -** Use the fdatasync() API only if the HAVE_FDATASYNC macro is defined.
  2828         -** Otherwise use fsync() in its place.
         2827  +** We assume that most systems these days support fdatasync().  Those
         2828  +** machines that do not can define -Dfdatasync=fsync.
  2829   2829   */
  2830         -#ifndef HAVE_FDATASYNC
         2830  +#if 0
  2831   2831   # define fdatasync fsync
  2832   2832   #endif
  2833   2833   
  2834   2834   /*
  2835   2835   ** Define HAVE_FULLFSYNC to 0 or 1 depending on whether or not
  2836   2836   ** the F_FULLFSYNC macro is defined.  F_FULLFSYNC is currently
  2837   2837   ** only available on Mac OS X.  But that could change.