SQLite

Check-in [385a08afef]
Login

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

Overview
Comment:Automatically check for the fdatasync() function and replace it with fsync() if not found. (CVS 2739)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 385a08afefaf552db221ae8bd30ecc7e7c07ee5b
User & Date: drh 2005-10-04 18:38:50.000
Context
2005-10-05
02:13
Add the SQLITE_OMIT_GET_TABLE compile-time flag. (CVS 2740) (check-in: 6d4bc8f83b user: drh tags: trunk)
2005-10-04
18:38
Automatically check for the fdatasync() function and replace it with fsync() if not found. (CVS 2739) (check-in: 385a08afef user: drh tags: trunk)
2005-10-03
15:11
The hash tables deallocate when empty in order to avoid nuisanse complaints from valgrind. Added tests to verify no hash table memory leaks in os_unix.c. (CVS 2738) (check-in: 080eadca58 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to configure.
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506






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

#########
# Programs needed
#
# Check whether --enable-shared or --disable-shared was given.
if test "${enable_shared+set}" = set; then
  enableval="$enable_shared"







|







1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506






# 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"
20334
20335
20336
20337
20338
20339
20340









































































































20341
20342
20343
20344
20345
20346
20347
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_usleep" >&5
echo "${ECHO_T}$ac_cv_func_usleep" >&6
if test $ac_cv_func_usleep = yes; then
  TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_USLEEP=1"
fi











































































































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







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







20334
20335
20336
20337
20338
20339
20340
20341
20342
20343
20344
20345
20346
20347
20348
20349
20350
20351
20352
20353
20354
20355
20356
20357
20358
20359
20360
20361
20362
20363
20364
20365
20366
20367
20368
20369
20370
20371
20372
20373
20374
20375
20376
20377
20378
20379
20380
20381
20382
20383
20384
20385
20386
20387
20388
20389
20390
20391
20392
20393
20394
20395
20396
20397
20398
20399
20400
20401
20402
20403
20404
20405
20406
20407
20408
20409
20410
20411
20412
20413
20414
20415
20416
20417
20418
20419
20420
20421
20422
20423
20424
20425
20426
20427
20428
20429
20430
20431
20432
20433
20434
20435
20436
20437
20438
20439
20440
20441
20442
20443
20444
20445
20446
20447
20448
20449
20450
20451
20452
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_usleep" >&5
echo "${ECHO_T}$ac_cv_func_usleep" >&6
if test $ac_cv_func_usleep = yes; then
  TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_USLEEP=1"
fi


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

echo "$as_me:$LINENO: checking for fdatasync" >&5
echo $ECHO_N "checking for fdatasync... $ECHO_C" >&6
if test "${ac_cv_func_fdatasync+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define fdatasync to an innocuous variant, in case <limits.h> declares fdatasync.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define fdatasync innocuous_fdatasync

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char fdatasync (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef fdatasync

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char fdatasync ();
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_fdatasync) || defined (__stub___fdatasync)
choke me
#else
char (*f) () = fdatasync;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != fdatasync;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_func_fdatasync=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_func_fdatasync=no
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
Changes to configure.ac.
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# 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.17 $

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








|







112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# 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

602
603
604
605
606
607
608







609
610
611
612
613
614
615
616
fi
AC_SUBST(TARGET_DEBUG)

#########
# Figure out whether or not we have a "usleep()" function.
#
AC_CHECK_FUNC(usleep, [TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_USLEEP=1"])








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







>
>
>
>
>
>
>








602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
fi
AC_SUBST(TARGET_DEBUG)

#########
# Figure out whether or not we have a "usleep()" function.
#
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
])