/ Check-in [115340d4]
Login

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

Overview
Comment:Another attempt to get fdatasync to be ignored on non-conforming posix systems. Now a system has to opt-in for fdatasync instead of opt-out. Ticket #1467. (CVS 2741)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 115340d4e85f1bbbab657edbb504284343d86e2c
User & Date: drh 2005-10-05 10:29:36
Context
2005-10-05
10:40
Changes to support TEA on cygwin. (CVS 2742) check-in: e80fecc9 user: drh tags: trunk
10:29
Another attempt to get fdatasync to be ignored on non-conforming posix systems. Now a system has to opt-in for fdatasync instead of opt-out. Ticket #1467. (CVS 2741) check-in: 115340d4 user: drh tags: trunk
02:13
Add the SQLITE_OMIT_GET_TABLE compile-time flag. (CVS 2740) check-in: 6d4bc8f8 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Makefile.linux-gcc.

49
50
51
52
53
54
55

56
57
58
59
60
61
62
#    You can make the library go almost twice as fast if you compile
#    with -DNDEBUG=1
#
#OPTS = -DSQLITE_DEBUG=2
#OPTS = -DSQLITE_DEBUG=1
#OPTS = 
OPTS = -DNDEBUG=1


#### The suffix to add to executable files.  ".exe" for windows.
#    Nothing for unix.
#
#EXE = .exe
EXE =








>







49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#    You can make the library go almost twice as fast if you compile
#    with -DNDEBUG=1
#
#OPTS = -DSQLITE_DEBUG=2
#OPTS = -DSQLITE_DEBUG=1
#OPTS = 
OPTS = -DNDEBUG=1
OPTS += -DHAVE_FDATASYNC=1

#### The suffix to add to executable files.  ".exe" for windows.
#    Nothing for unix.
#
#EXE = .exe
EXE =

Changes to configure.

1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
.....
20431
20432
20433
20434
20435
20436
20437
20438
20439
20440
20441
20442
20443

20444
20445
20446
20447
20448
20449
20450
20451
20452






# The following RCS revision string applies to configure.in
# $Revision: 1.32 $

#########
# Programs needed
#
# Check whether --enable-shared or --disable-shared was given.
if test "${enable_shared+set}" = set; then
  enableval="$enable_shared"
................................................................................
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_fdatasync" >&5
echo "${ECHO_T}$ac_cv_func_fdatasync" >&6
if test $ac_cv_func_fdatasync = yes; then
  :
else
  cat >>confdefs.h <<\_ACEOF
#define fdatasync fsync
_ACEOF


fi



#########
# Generate the output files.
#
                    ac_config_files="$ac_config_files Makefile sqlite3.pc"
cat >confcache <<\_ACEOF







|







 







<
<
<
<
<
<
>

<







1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
.....
20431
20432
20433
20434
20435
20436
20437






20438
20439

20440
20441
20442
20443
20444
20445
20446






# The following RCS revision string applies to configure.in
# $Revision: 1.33 $

#########
# Programs needed
#
# Check whether --enable-shared or --disable-shared was given.
if test "${enable_shared+set}" = set; then
  enableval="$enable_shared"
................................................................................
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_fdatasync" >&5
echo "${ECHO_T}$ac_cv_func_fdatasync" >&6
if test $ac_cv_func_fdatasync = yes; then






  TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_FDATASYNC=1"
fi



#########
# Generate the output files.
#
                    ac_config_files="$ac_config_files Makefile sqlite3.pc"
cat >confcache <<\_ACEOF

Changes to configure.ac.

112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
...
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
# the corresponding code.
#
AC_INIT(src/sqlite.h.in)

dnl Put the RCS revision string after AC_INIT so that it will also
dnl show in in configure.
# The following RCS revision string applies to configure.in
# $Revision: 1.18 $

#########
# Programs needed
#
AC_PROG_LIBTOOL
AC_PROG_INSTALL

................................................................................
#
AC_CHECK_FUNC(usleep, [TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_USLEEP=1"])

#--------------------------------------------------------------------
# Redefine fdatasync as fsync on systems that lack fdatasync
#--------------------------------------------------------------------

AC_CHECK_FUNC(fdatasync, , AC_DEFINE(fdatasync, fsync))


#########
# Generate the output files.
#
AC_OUTPUT([
Makefile
sqlite3.pc
])







|







 







|
<








112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
...
607
608
609
610
611
612
613
614

615
616
617
618
619
620
621
622
# the corresponding code.
#
AC_INIT(src/sqlite.h.in)

dnl Put the RCS revision string after AC_INIT so that it will also
dnl show in in configure.
# The following RCS revision string applies to configure.in
# $Revision: 1.19 $

#########
# Programs needed
#
AC_PROG_LIBTOOL
AC_PROG_INSTALL

................................................................................
#
AC_CHECK_FUNC(usleep, [TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_USLEEP=1"])

#--------------------------------------------------------------------
# Redefine fdatasync as fsync on systems that lack fdatasync
#--------------------------------------------------------------------

AC_CHECK_FUNC(fdatasync, [TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_FDATASYNC=1"])


#########
# Generate the output files.
#
AC_OUTPUT([
Makefile
sqlite3.pc
])

Changes to src/os_unix.c.

784
785
786
787
788
789
790








791
792
793
794
795
796
797
...
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
** Count the number of fullsyncs and normal syncs.  This is used to test
** that syncs and fullsyncs are occuring at the right times.
*/
int sqlite3_sync_count = 0;
int sqlite3_fullsync_count = 0;
#endif










/*
** The fsync() system call does not work as advertised on many
** unix systems.  The following procedure is an attempt to make
** it work better.
**
** The SQLITE_NO_SYNC macro disables all fsync()s.  This is useful
................................................................................
  }else{
    rc = 1;
  }
  /* If the FULLSYNC failed, try to do a normal fsync() */
  if( rc ) rc = fsync(fd);

#else /* if !defined(F_FULLSYNC) */
#if  defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO>0
  if( dataOnly ){
    rc = fdatasync(fd);
  }else
#endif /* _POSIX_SYNCHRONIZED_IO > 0 */
  {
    rc = fsync(fd);
  }
#endif /* defined(F_FULLFSYNC) */
#endif /* defined(SQLITE_NO_SYNC) */

  return rc;
}







>
>
>
>
>
>
>
>







 







<


|
<
<







784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
...
833
834
835
836
837
838
839

840
841
842


843
844
845
846
847
848
849
** Count the number of fullsyncs and normal syncs.  This is used to test
** that syncs and fullsyncs are occuring at the right times.
*/
int sqlite3_sync_count = 0;
int sqlite3_fullsync_count = 0;
#endif

/*
** Use the fdatasync() API only if the HAVE_FDATASYNC macro is defined.
** Otherwise use fsync() in its place.
*/
#ifndef HAVE_FDATASYNC
# define fdatasync fsync
#endif


/*
** The fsync() system call does not work as advertised on many
** unix systems.  The following procedure is an attempt to make
** it work better.
**
** The SQLITE_NO_SYNC macro disables all fsync()s.  This is useful
................................................................................
  }else{
    rc = 1;
  }
  /* If the FULLSYNC failed, try to do a normal fsync() */
  if( rc ) rc = fsync(fd);

#else /* if !defined(F_FULLSYNC) */

  if( dataOnly ){
    rc = fdatasync(fd);
  }else{


    rc = fsync(fd);
  }
#endif /* defined(F_FULLFSYNC) */
#endif /* defined(SQLITE_NO_SYNC) */

  return rc;
}