From eb82000f3fb01baa7db2b1578e450dae23fcfec1 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 28 Jan 1999 21:24:43 +0000 Subject: [PATCH] Import non-reentrant database "big mutex" code from -devel. --- configure | 517 ++++++++++++++-------------- configure.in | 36 +- include/getopt-compat.h | 4 + include/ldbm.h | 31 +- include/portable.h.in | 3 + libraries/libldbm/ldbm.c | 243 +++++++++---- servers/slapd/back-ldbm/back-ldbm.h | 11 +- servers/slapd/back-ldbm/dbcache.c | 38 -- servers/slapd/back-ldbm/init.c | 14 +- 9 files changed, 477 insertions(+), 420 deletions(-) diff --git a/configure b/configure index 711604d7a1..eef21dc8ef 100755 --- a/configure +++ b/configure @@ -4789,43 +4789,64 @@ EOF ol_with_yielding_select=yes fi - echo $ac_n "checking for misplaced posix thread in headers""... $ac_c" 1>&6 -echo "configure:4794: checking for misplaced posix thread in headers" >&5 -if eval "test \"`echo '$''{'ol_cv_header_misplaced_pthreads'+set}'`\" = set"; then + for ac_func in \ + thr_setconcurrency \ + thr_getconcurrency \ + +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:4799: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - - cat > conftest.$ac_ext < conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); -#include -typedef double pthread_t; - int main() { - pthread_t thread = 0.0; - +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + ; return 0; } EOF -if { (eval echo configure:4812: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - ol_cv_header_misplaced_pthreads=no + eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - ol_cv_header_misplaced_pthreads=yes + eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - fi -echo "$ac_t""$ol_cv_header_misplaced_pthreads" 1>&6 +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done - if test "$ol_cv_header_misplaced_pthreads" = yes ; then - { echo "configure: error: pthread types are misplaced, use --with-threads=posix" 1>&2; exit 1; }; - fi fi fi @@ -4833,17 +4854,17 @@ echo "$ac_t""$ol_cv_header_misplaced_pthreads" 1>&6 do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4837: checking for $ac_hdr" >&5 +echo "configure:4858: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4847: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4868: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4871,7 +4892,7 @@ done if test $ac_cv_header_lwp_lwp_h = yes ; then echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6 -echo "configure:4875: checking for lwp_create in -llwp" >&5 +echo "configure:4896: checking for lwp_create in -llwp" >&5 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4879,7 +4900,7 @@ else ac_save_LIBS="$LIBS" LIBS="-llwp $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4943,17 +4964,17 @@ if test $ol_with_threads = manual ; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4947: checking for $ac_hdr" >&5 +echo "configure:4968: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4957: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4982,12 +5003,12 @@ done for ac_func in sched_yield pthread_yield do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4986: checking for $ac_func" >&5 +echo "configure:5007: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5036,7 +5057,7 @@ done echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6 -echo "configure:5040: checking for LinuxThreads" >&5 +echo "configure:5061: checking for LinuxThreads" >&5 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5057,17 +5078,17 @@ echo "$ac_t""$ol_cv_linux_threads" 1>&6 do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5061: checking for $ac_hdr" >&5 +echo "configure:5082: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5097,17 +5118,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5101: checking for $ac_hdr" >&5 +echo "configure:5122: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5132: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5137,17 +5158,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5141: checking for $ac_hdr" >&5 +echo "configure:5162: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5151: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5202,13 +5223,13 @@ EOF echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6 -echo "configure:5206: checking for thread specific errno" >&5 +echo "configure:5227: checking for thread specific errno" >&5 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5219,7 +5240,7 @@ int x = errno; ; return 0; } EOF -if { (eval echo configure:5223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ol_cv_errno_thread_specific=yes else @@ -5251,44 +5272,6 @@ if test $ol_link_threads = no ; then ol_with_threads=no fi - echo $ac_n "checking for misplaced posix thread in headers""... $ac_c" 1>&6 -echo "configure:5256: checking for misplaced posix thread in headers" >&5 -if eval "test \"`echo '$''{'ol_cv_header_misplaced_pthreads'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - - cat > conftest.$ac_ext < -typedef double pthread_t; - -int main() { - - pthread_t thread = 0.0; - -; return 0; } -EOF -if { (eval echo configure:5274: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ol_cv_header_misplaced_pthreads=no -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ol_cv_header_misplaced_pthreads=yes -fi -rm -f conftest* - -fi - -echo "$ac_t""$ol_cv_header_misplaced_pthreads" 1>&6 - - if test "$ol_cv_header_misplaced_pthreads" = yes ; then - { echo "configure: error: pthread types are misplaced, use --with-threads=posix" 1>&2; exit 1; }; - fi - cat >> confdefs.h <<\EOF #define NO_THREADS 1 EOF @@ -5299,13 +5282,13 @@ fi ol_link_ldbm=no if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then echo $ac_n "checking for DB2 library""... $ac_c" 1>&6 -echo "configure:5303: checking for DB2 library" >&5 +echo "configure:5286: checking for DB2 library" >&5 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ol_LIBS="$LIBS" echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6 -echo "configure:5309: checking for db_open in -ldb" >&5 +echo "configure:5292: checking for db_open in -ldb" >&5 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5313,7 +5296,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldb $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5355,17 +5338,17 @@ for ac_hdr in db.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5359: checking for $ac_hdr" >&5 +echo "configure:5342: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5369: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5352: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5393,13 +5376,13 @@ done if test $ac_cv_header_db_h = yes ; then echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6 -echo "configure:5397: checking if db.h is DB2" >&5 +echo "configure:5380: checking if db.h is DB2" >&5 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5431,7 +5414,7 @@ fi echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6 -echo "configure:5435: checking for Berkeley DB2" >&5 +echo "configure:5418: checking for Berkeley DB2" >&5 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5477,18 +5460,18 @@ fi if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6 -echo "configure:5481: checking for Berkeley DB library" >&5 +echo "configure:5464: checking for Berkeley DB library" >&5 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ol_LIBS="$LIBS" echo $ac_n "checking for dbopen""... $ac_c" 1>&6 -echo "configure:5487: checking for dbopen" >&5 +echo "configure:5470: checking for dbopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_dbopen=yes" else @@ -5530,7 +5513,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6 -echo "configure:5534: checking for dbopen in -ldb" >&5 +echo "configure:5517: checking for dbopen in -ldb" >&5 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5538,7 +5521,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldb $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5584,17 +5567,17 @@ for ac_hdr in db_185.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5588: checking for $ac_hdr" >&5 +echo "configure:5571: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5598: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5581: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5630,7 +5613,7 @@ fi echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6 -echo "configure:5634: checking for Berkeley DB" >&5 +echo "configure:5617: checking for Berkeley DB" >&5 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5683,17 +5666,17 @@ if test $ol_with_ldbm_api = manual ; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5687: checking for $ac_hdr" >&5 +echo "configure:5670: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5697: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5728,18 +5711,18 @@ fi if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then echo $ac_n "checking for GDBM library""... $ac_c" 1>&6 -echo "configure:5732: checking for GDBM library" >&5 +echo "configure:5715: checking for GDBM library" >&5 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ol_LIBS="$LIBS" echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6 -echo "configure:5738: checking for gdbm_open" >&5 +echo "configure:5721: checking for gdbm_open" >&5 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_gdbm_open=yes" else @@ -5781,7 +5764,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6 -echo "configure:5785: checking for gdbm_open in -lgdbm" >&5 +echo "configure:5768: checking for gdbm_open in -lgdbm" >&5 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5789,7 +5772,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgdbm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5835,17 +5818,17 @@ echo "$ac_t""$ol_cv_lib_gdbm" 1>&6 do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5839: checking for $ac_hdr" >&5 +echo "configure:5822: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5849: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5872,7 +5855,7 @@ fi done echo $ac_n "checking for db""... $ac_c" 1>&6 -echo "configure:5876: checking for db" >&5 +echo "configure:5859: checking for db" >&5 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5908,18 +5891,18 @@ if test $ol_with_ldbm_api = auto ; then echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2 elif test $ol_with_ldbm_api = ndbm ; then echo $ac_n "checking for NDBM library""... $ac_c" 1>&6 -echo "configure:5912: checking for NDBM library" >&5 +echo "configure:5895: checking for NDBM library" >&5 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ol_LIBS="$LIBS" echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 -echo "configure:5918: checking for dbm_open" >&5 +echo "configure:5901: checking for dbm_open" >&5 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_dbm_open=yes" else @@ -5961,7 +5944,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6 -echo "configure:5965: checking for dbm_open in -lndbm" >&5 +echo "configure:5948: checking for dbm_open in -lndbm" >&5 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5969,7 +5952,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lndbm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6000,7 +5983,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6 -echo "configure:6004: checking for dbm_open in -ldbm" >&5 +echo "configure:5987: checking for dbm_open in -ldbm" >&5 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6008,7 +5991,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldbm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6056,17 +6039,17 @@ echo "$ac_t""$ol_cv_lib_ndbm" 1>&6 do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6060: checking for $ac_hdr" >&5 +echo "configure:6043: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6070: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6093,7 +6076,7 @@ fi done echo $ac_n "checking for db""... $ac_c" 1>&6 -echo "configure:6097: checking for db" >&5 +echo "configure:6080: checking for db" >&5 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6140,17 +6123,17 @@ if test $ol_enable_wrappers != no ; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6144: checking for $ac_hdr" >&5 +echo "configure:6127: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6154: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6137: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6181,7 +6164,7 @@ done have_wrappers=no else echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6 -echo "configure:6185: checking for main in -lwrap" >&5 +echo "configure:6168: checking for main in -lwrap" >&5 ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6189,14 +6172,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lwrap $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6242,17 +6225,17 @@ for ac_hdr in termcap.h ncurses.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6246: checking for $ac_hdr" >&5 +echo "configure:6229: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6256: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6281,7 +6264,7 @@ done if test $ol_link_termcap = no ; then echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6 -echo "configure:6285: checking for tputs in -ltermcap" >&5 +echo "configure:6268: checking for tputs in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6289,7 +6272,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6333,7 +6316,7 @@ fi if test $ol_link_termcap = no ; then echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6 -echo "configure:6337: checking for initscr in -lncurses" >&5 +echo "configure:6320: checking for initscr in -lncurses" >&5 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6341,7 +6324,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6394,12 +6377,12 @@ fi # FreeBSD (and others) have crypt(3) in -lcrypt if test $ol_enable_crypt != no ; then echo $ac_n "checking for crypt""... $ac_c" 1>&6 -echo "configure:6398: checking for crypt" >&5 +echo "configure:6381: checking for crypt" >&5 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_crypt=yes" else @@ -6441,7 +6424,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:6445: checking for crypt in -lcrypt" >&5 +echo "configure:6428: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6449,7 +6432,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6504,12 +6487,12 @@ fi # FreeBSD (and others) have setproctitle(3) in -lutil if test $ol_enable_proctitle != no ; then echo $ac_n "checking for setproctitle""... $ac_c" 1>&6 -echo "configure:6508: checking for setproctitle" >&5 +echo "configure:6491: checking for setproctitle" >&5 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_setproctitle=yes" else @@ -6551,7 +6534,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6 -echo "configure:6555: checking for setproctitle in -lutil" >&5 +echo "configure:6538: checking for setproctitle in -lutil" >&5 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6559,7 +6542,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lutil $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6605,12 +6588,12 @@ EOF fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:6609: checking for ANSI C header files" >&5 +echo "configure:6592: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6618,7 +6601,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6635,7 +6618,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -6653,7 +6636,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -6674,7 +6657,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -6685,7 +6668,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:6689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -6718,12 +6701,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:6722: checking for $ac_hdr that defines DIR" >&5 +echo "configure:6705: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -6731,7 +6714,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:6735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -6756,7 +6739,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:6760: checking for opendir in -ldir" >&5 +echo "configure:6743: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6764,7 +6747,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6797,7 +6780,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:6801: checking for opendir in -lx" >&5 +echo "configure:6784: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6805,7 +6788,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6839,12 +6822,12 @@ fi fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:6843: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:6826: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6860,7 +6843,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:6864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -6881,12 +6864,12 @@ EOF fi echo $ac_n "checking POSIX termios""... $ac_c" 1>&6 -echo "configure:6885: checking POSIX termios" >&5 +echo "configure:6868: checking POSIX termios" >&5 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6896,7 +6879,7 @@ int main() { tcgetattr(0, 0); ; return 0; } EOF -if { (eval echo configure:6900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* am_cv_sys_posix_termios=yes else @@ -6912,7 +6895,7 @@ echo "$ac_t""$am_cv_sys_posix_termios" 1>&6 echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6 -echo "configure:6916: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5 +echo "configure:6899: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6921,7 +6904,7 @@ else gwinsz_in_termios_h=no if test $am_cv_sys_posix_termios = yes; then cat > conftest.$ac_ext < # include @@ -6941,7 +6924,7 @@ rm -f conftest* if test $gwinsz_in_termios_h = no; then cat > conftest.$ac_ext < # include @@ -7011,17 +6994,17 @@ for ac_hdr in \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7015: checking for $ac_hdr" >&5 +echo "configure:6998: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7049,12 +7032,12 @@ done echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:7053: checking for uid_t in sys/types.h" >&5 +echo "configure:7036: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -7083,7 +7066,7 @@ EOF fi echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6 -echo "configure:7087: checking type of array argument to getgroups" >&5 +echo "configure:7070: checking type of array argument to getgroups" >&5 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7091,7 +7074,7 @@ else ac_cv_type_getgroups=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_type_getgroups=gid_t else @@ -7130,7 +7113,7 @@ fi if test $ac_cv_type_getgroups = cross; then cat > conftest.$ac_ext < EOF @@ -7153,12 +7136,12 @@ cat >> confdefs.h <&6 -echo "configure:7157: checking for mode_t" >&5 +echo "configure:7140: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -7186,12 +7169,12 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:7190: checking for off_t" >&5 +echo "configure:7173: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -7219,12 +7202,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:7223: checking for pid_t" >&5 +echo "configure:7206: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -7252,19 +7235,19 @@ EOF fi echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6 -echo "configure:7256: checking for ptrdiff_t" >&5 +echo "configure:7239: checking for ptrdiff_t" >&5 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { ptrdiff_t p ; return 0; } EOF -if { (eval echo configure:7268: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7251: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_type_ptrdiff_t=yes else @@ -7285,12 +7268,12 @@ EOF fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:7289: checking return type of signal handlers" >&5 +echo "configure:7272: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -7307,7 +7290,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:7311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7294: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -7326,12 +7309,12 @@ EOF echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:7330: checking for size_t" >&5 +echo "configure:7313: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -7359,12 +7342,12 @@ EOF fi echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 -echo "configure:7363: checking for st_blksize in struct stat" >&5 +echo "configure:7346: checking for st_blksize in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -7372,7 +7355,7 @@ int main() { struct stat s; s.st_blksize; ; return 0; } EOF -if { (eval echo configure:7376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blksize=yes else @@ -7393,12 +7376,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:7397: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:7380: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -7407,7 +7390,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:7411: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -7428,12 +7411,12 @@ EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:7432: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:7415: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -7441,7 +7424,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:7445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -7464,7 +7447,7 @@ fi echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6 -echo "configure:7468: checking if toupper() requires islower()" >&5 +echo "configure:7451: checking if toupper() requires islower()" >&5 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7473,7 +7456,7 @@ else ol_cv_c_upper_lower=safe else cat > conftest.$ac_ext < @@ -7485,7 +7468,7 @@ main() exit(1); } EOF -if { (eval echo configure:7489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ol_cv_c_upper_lower=no else @@ -7508,12 +7491,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:7512: checking for working const" >&5 +echo "configure:7495: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -7590,14 +7573,14 @@ EOF else echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:7594: checking whether byte ordering is bigendian" >&5 +echo "configure:7577: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -7608,11 +7591,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:7612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -7623,7 +7606,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:7627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7610: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -7643,7 +7626,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -7680,7 +7663,7 @@ EOF fi echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:7684: checking size of short" >&5 +echo "configure:7667: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7688,7 +7671,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -7699,7 +7682,7 @@ main() exit(0); } EOF -if { (eval echo configure:7703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else @@ -7719,7 +7702,7 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:7723: checking size of int" >&5 +echo "configure:7706: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7727,7 +7710,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -7738,7 +7721,7 @@ main() exit(0); } EOF -if { (eval echo configure:7742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -7758,7 +7741,7 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:7762: checking size of long" >&5 +echo "configure:7745: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7766,7 +7749,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -7777,7 +7760,7 @@ main() exit(0); } EOF -if { (eval echo configure:7781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -7799,7 +7782,7 @@ EOF fi echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:7803: checking for 8-bit clean memcmp" >&5 +echo "configure:7786: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7807,7 +7790,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -7835,12 +7818,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o" echo $ac_n "checking for strftime""... $ac_c" 1>&6 -echo "configure:7839: checking for strftime" >&5 +echo "configure:7822: checking for strftime" >&5 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_strftime=yes" else @@ -7885,7 +7868,7 @@ else echo "$ac_t""no" 1>&6 # strftime is in -lintl on SCO UNIX. echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6 -echo "configure:7889: checking for strftime in -lintl" >&5 +echo "configure:7872: checking for strftime in -lintl" >&5 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7893,7 +7876,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7931,12 +7914,12 @@ fi fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:7935: checking for vprintf" >&5 +echo "configure:7918: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -7983,12 +7966,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:7987: checking for _doprnt" >&5 +echo "configure:7970: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -8040,12 +8023,12 @@ if test $ac_cv_func_vprintf = yes ; then for ac_func in vsnprintf vsprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8044: checking for $ac_func" >&5 +echo "configure:8027: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8125,12 +8108,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8129: checking for $ac_func" >&5 +echo "configure:8112: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8181,12 +8164,12 @@ done for ac_func in getopt strdup tempnam do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8185: checking for $ac_func" >&5 +echo "configure:8168: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8239,13 +8222,13 @@ done # Check Configuration echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6 -echo "configure:8243: checking declaration of sys_errlist" >&5 +echo "configure:8226: checking declaration of sys_errlist" >&5 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -8255,7 +8238,7 @@ int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:8259: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8242: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_dcl_sys_errlist=yes else @@ -8276,20 +8259,20 @@ if test $ol_cv_dcl_sys_errlist = no ; then EOF echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6 -echo "configure:8280: checking existence of sys_errlist" >&5 +echo "configure:8263: checking existence of sys_errlist" >&5 if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:8293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ol_cv_have_sys_errlist=yes else diff --git a/configure.in b/configure.in index 9936807dfa..74a42b4992 100644 --- a/configure.in +++ b/configure.in @@ -808,21 +808,11 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \ ol_with_yielding_select=yes fi - AC_CACHE_CHECK([for misplaced posix thread in headers], - [ol_cv_header_misplaced_pthreads], [ - AC_TRY_COMPILE([ -#include -typedef double pthread_t; - ], [ - pthread_t thread = 0.0; - ], - [ol_cv_header_misplaced_pthreads=no], - [ol_cv_header_misplaced_pthreads=yes]) - ]) - - if test "$ol_cv_header_misplaced_pthreads" = yes ; then - AC_MSG_ERROR([pthread types are misplaced, use --with-threads=posix]); - fi + dnl Check for setconcurreny functions + AC_CHECK_FUNCS( \ + thr_setconcurrency \ + thr_getconcurrency \ + ) fi fi @@ -905,22 +895,6 @@ if test $ol_link_threads = no ; then ol_with_threads=no fi - AC_CACHE_CHECK([for misplaced posix thread in headers], - [ol_cv_header_misplaced_pthreads], [ - AC_TRY_COMPILE([ -#include -typedef double pthread_t; - ], [ - pthread_t thread = 0.0; - ], - [ol_cv_header_misplaced_pthreads=no], - [ol_cv_header_misplaced_pthreads=yes]) - ]) - - if test "$ol_cv_header_misplaced_pthreads" = yes ; then - AC_MSG_ERROR([pthread types are misplaced, use --with-threads=posix]); - fi - AC_DEFINE(NO_THREADS,1) LTHREAD_LIBS="" fi diff --git a/include/getopt-compat.h b/include/getopt-compat.h index a32e8b5b36..438eb53388 100644 --- a/include/getopt-compat.h +++ b/include/getopt-compat.h @@ -15,9 +15,13 @@ #include +LDAP_BEGIN_DECL + extern char *optarg; extern int optind, opterr, optopt; LDAP_F int getopt LDAP_P((int, char * const [], const char *)); +LDAP_END_DECL + #endif /* _GETOPT_COMPAT_H */ diff --git a/include/ldbm.h b/include/ldbm.h index 0a7edcdf13..3f55a6ffea 100644 --- a/include/ldbm.h +++ b/include/ldbm.h @@ -12,6 +12,8 @@ #ifndef _LDBM_H_ #define _LDBM_H_ +#include + #ifdef LDBM_USE_DBBTREE /***************************************************************** @@ -24,7 +26,7 @@ #include #include -#ifdef HAVE_DB185_H +#ifdef HAVE_DB_185_H # include #else # include @@ -35,12 +37,16 @@ #endif +LDAP_BEGIN_DECL + typedef DBT Datum; #define dsize size #define dptr data typedef DB *LDBM; +LDAP_END_DECL + #define DB_TYPE DB_BTREE /* for ldbm_open */ @@ -78,7 +84,7 @@ typedef DB *LDBM; #include #include -#ifdef HAVE_DB185_H +#ifdef HAVE_DB_185_H # include #else # include @@ -88,12 +94,16 @@ typedef DB *LDBM; # endif #endif +LDAP_BEGIN_DECL + typedef DBT Datum; #define dsize size #define dptr data typedef DB *LDBM; +LDAP_END_DECL + #define DB_TYPE DB_HASH /* for ldbm_open */ @@ -127,12 +137,16 @@ typedef DB *LDBM; #include +LDAP_BEGIN_DECL + typedef datum Datum; typedef GDBM_FILE LDBM; extern gdbm_error gdbm_errno; +LDAP_END_DECL + /* for ldbm_open */ #define LDBM_READER GDBM_READER #define LDBM_WRITER GDBM_WRITER @@ -162,10 +176,14 @@ extern gdbm_error gdbm_errno; #include #endif +LDAP_BEGIN_DECL + typedef datum Datum; typedef DBM *LDBM; +LDAP_END_DECL + /* for ldbm_open */ #define LDBM_READER O_RDONLY #define LDBM_WRITER O_WRONLY @@ -182,6 +200,9 @@ typedef DBM *LDBM; #endif +LDAP_BEGIN_DECL + +void ldbm_initialize( void ); int ldbm_errno( LDBM ldbm ); LDBM ldbm_open( char *name, int rw, int mode, int dbcachesize ); void ldbm_close( LDBM ldbm ); @@ -204,13 +225,11 @@ int ldbm_delete( LDBM ldbm, Datum key ); /* initialization of Datum structures */ #ifdef HAVE_BERKELEY_DB2 - # define ldbm_datum_init(d) ((void)memset(&(d), 0, sizeof(Datum))) - #else - # define ldbm_datum_init(d) ((void)0) - #endif /* HAVE_BERKELEY_DB2 */ +LDAP_END_DECL + #endif /* _ldbm_h_ */ diff --git a/include/portable.h.in b/include/portable.h.in index aff2ddbee4..612775772a 100644 --- a/include/portable.h.in +++ b/include/portable.h.in @@ -395,6 +395,9 @@ /* Define if you have the tempnam function. */ #undef HAVE_TEMPNAM +/* Define if you have the thr_getconcurrency function. */ +#undef HAVE_THR_GETCONCURRENCY + /* Define if you have the thr_setconcurrency function. */ #undef HAVE_THR_SETCONCURRENCY diff --git a/libraries/libldbm/ldbm.c b/libraries/libldbm/ldbm.c index ca3f15d258..d83bde5f6d 100644 --- a/libraries/libldbm/ldbm.c +++ b/libraries/libldbm/ldbm.c @@ -19,6 +19,7 @@ #include #include "ldbm.h" +#include "lthread.h" #if defined( LDBM_USE_DBHASH ) || defined( LDBM_USE_DBBTREE ) @@ -29,11 +30,6 @@ *****************************************************************/ #ifdef HAVE_BERKELEY_DB2 -/************************************************* - * * - * A malloc routine for use with DB_DBT_MALLOC * - * * - *************************************************/ void * ldbm_malloc( size_t size ) @@ -41,14 +37,7 @@ ldbm_malloc( size_t size ) return( calloc( 1, size )); } -/* a dbEnv for BERKELEYv2 */ -#include "lthread.h" - -DB_ENV dbEnv; -int dbEnvInit = 0; -pthread_mutex_t dbEnvInit_mutex; - -void +static void ldbm_db_errcall( const char *prefix, char *message ) { @@ -56,68 +45,81 @@ ldbm_db_errcall( const char *prefix, char *message ) } -#endif +/* a dbEnv for BERKELEYv2 */ +static DB_ENV ldbm_Env; +/* Berkeley DB 2.x is reentrant */ +#define LDBM_LOCK ((void)0) +#define LDBM_UNLOCK ((void)0) -LDBM -ldbm_open( char *name, int rw, int mode, int dbcachesize ) +void ldbm_initialize( void ) { - LDBM ret = NULL; + static int initialized = 0; -#ifdef HAVE_BERKELEY_DB2 - DB_INFO dbinfo; + int err; + int envFlags; - /* initialize an environment for the DB application */ - pthread_mutex_lock( &dbEnvInit_mutex ); + if(initialized++) return; - if ( !dbEnvInit ) { - char *dir; - char tmp[BUFSIZ]; - int err = 0; - int envFlags = DB_CREATE | DB_THREAD; + memset( &ldbm_Env, 0, sizeof( ldbm_Env )); - strcpy( tmp, name ); - if ( ( dir = strrchr( tmp, '/' )) ) { + ldbm_Env.db_errcall = ldbm_db_errcall; + ldbm_Env.db_errpfx = "==>"; - *dir ='\0'; - dir = tmp; + envFlags = DB_CREATE | DB_THREAD; + if ( ( err = db_appinit( NULL, NULL, &ldbm_Env, envFlags )) ) { + char error[BUFSIZ]; + + if ( err < 0 ) { + sprintf( error, "%ld\n", (long) err ); } else { + sprintf( error, "%s\n", strerror( err )); + } - dir = "/"; + syslog( LOG_INFO, + "ldbm_initialize(): FATAL error in db_appinit() : %s\n", + error ); + exit( 1 ); + } +} - } +#else - memset( &dbEnv, 0, sizeof( dbEnv )); +/* DB 1.85 is non-reentrant */ +static pthread_mutex_t ldbm_big_mutex; +#define LDBM_LOCK (pthread_mutex_lock(&ldbm_big_mutex)) +#define LDBM_UNLOCK (pthread_mutex_unlock(&ldbm_big_mutex)) - dbEnv.db_errcall = ldbm_db_errcall; - dbEnv.db_errpfx = "==>"; +void ldbm_initialize( void ) +{ + static int initialized = 0; - if ( ( err = db_appinit( NULL, NULL, &dbEnv, envFlags )) ) { - char error[BUFSIZ]; + if(initialized++) return; - if ( err < 0 ) sprintf( error, "%ld\n", (long) err ); - else sprintf( error, "%s\n", strerror( err )); + pthread_mutex_init( &ldbm_big_mutex, pthread_mutexattr_default ); +} - syslog( LOG_INFO, - "ldbm_open(): FATAL error in db_appinit(%s) : %s\n", - dir, error ); +#endif - exit( 1 ); - } - dbEnvInit = 1; +LDBM +ldbm_open( char *name, int rw, int mode, int dbcachesize ) +{ + LDBM ret = NULL; - } - pthread_mutex_unlock( &dbEnvInit_mutex ); +#ifdef HAVE_BERKELEY_DB2 + DB_INFO dbinfo; memset( &dbinfo, 0, sizeof( dbinfo )); dbinfo.db_cachesize = dbcachesize; dbinfo.db_pagesize = DEFAULT_DB_PAGE_SIZE; dbinfo.db_malloc = ldbm_malloc; - (void) db_open( name, DB_TYPE, rw, mode, &dbEnv, &dbinfo, &ret ); + LDBM_LOCK; + (void) db_open( name, DB_TYPE, rw, mode, &ldbm_Env, &dbinfo, &ret ); + LDBM_UNLOCK; #else void *info; @@ -136,7 +138,9 @@ ldbm_open( char *name, int rw, int mode, int dbcachesize ) info = NULL; } + LDBM_LOCK; ret = dbopen( name, rw, mode, DB_TYPE, info ); + LDBM_UNLOCK; #endif @@ -146,17 +150,21 @@ ldbm_open( char *name, int rw, int mode, int dbcachesize ) void ldbm_close( LDBM ldbm ) { + LDBM_LOCK; #ifdef HAVE_BERKELEY_DB2 (*ldbm->close)( ldbm, 0 ); #else (*ldbm->close)( ldbm ); #endif + LDBM_UNLOCK; } void ldbm_sync( LDBM ldbm ) { + LDBM_LOCK; (*ldbm->sync)( ldbm, 0 ); + LDBM_UNLOCK; } void @@ -188,6 +196,8 @@ ldbm_fetch( LDBM ldbm, Datum key ) Datum data; int rc; + LDBM_LOCK; + #ifdef HAVE_BERKELEY_DB2 ldbm_datum_init( data ); @@ -204,6 +214,8 @@ ldbm_fetch( LDBM ldbm, Datum key ) data.dsize = 0; } + LDBM_UNLOCK; + return( data ); } @@ -212,6 +224,8 @@ ldbm_store( LDBM ldbm, Datum key, Datum data, int flags ) { int rc; + LDBM_LOCK; + #ifdef HAVE_BERKELEY_DB2 rc = (*ldbm->put)( ldbm, NULL, &key, &data, flags & ~LDBM_SYNC ); rc = (-1 ) * rc; @@ -221,6 +235,9 @@ ldbm_store( LDBM ldbm, Datum key, Datum data, int flags ) if ( flags & LDBM_SYNC ) (*ldbm->sync)( ldbm, 0 ); + + LDBM_UNLOCK; + return( rc ); } @@ -229,6 +246,8 @@ ldbm_delete( LDBM ldbm, Datum key ) { int rc; + LDBM_LOCK; + #ifdef HAVE_BERKELEY_DB2 rc = (*ldbm->del)( ldbm, NULL, &key, 0 ); rc = (-1 ) * rc; @@ -236,6 +255,9 @@ ldbm_delete( LDBM ldbm, Datum key ) rc = (*ldbm->del)( ldbm, &key, 0 ); #endif (*ldbm->sync)( ldbm, 0 ); + + LDBM_UNLOCK; + return( rc ); } @@ -257,6 +279,8 @@ ldbm_firstkey( LDBM ldbm ) key.flags = data.flags = DB_DBT_MALLOC; + LDBM_LOCK; + /* acquire a cursor for the DB */ # if defined( DB_VERSION_MAJOR ) && defined( DB_VERSION_MINOR ) && \ @@ -276,6 +300,9 @@ ldbm_firstkey( LDBM ldbm ) if ( (*dbci->c_get)( dbci, &key, &data, DB_NEXT ) == 0 ) { if ( data.dptr ) free( data.dptr ); #else + + LDBM_LOCK; + if ( (rc = (*ldbm->seq)( ldbm, &key, &data, R_FIRST )) == 0 ) { key = ldbm_datum_dup( ldbm, key ); #endif @@ -288,6 +315,8 @@ ldbm_firstkey( LDBM ldbm ) } #endif + LDBM_UNLOCK; + return( key ); } @@ -308,9 +337,14 @@ ldbm_nextkey( LDBM ldbm, Datum key ) data.flags = DB_DBT_MALLOC; + LDBM_LOCK; + if ( (*dbcp->c_get)( dbcp, &key, &data, DB_NEXT ) == 0 ) { if ( data.dptr ) free( data.dptr ); #else + + LDBM_LOCK; + if ( (rc = (*ldbm->seq)( ldbm, &key, &data, R_NEXT )) == 0 ) { key = ldbm_datum_dup( ldbm, key ); #endif @@ -318,6 +352,9 @@ ldbm_nextkey( LDBM ldbm, Datum key ) key.dptr = NULL; key.dsize = 0; } + + LDBM_UNLOCK; + #ifdef HAVE_BERKELEY_DB2 if ( oldKey ) free( oldKey ); #endif @@ -335,6 +372,20 @@ ldbm_errno( LDBM ldbm ) #include +/* GDBM is non-reentrant */ +static pthread_mutex_t ldbm_big_mutex; +#define LDBM_LOCK (pthread_mutex_lock(&ldbm_big_mutex)) +#define LDBM_UNLOCK (pthread_mutex_unlock(&ldbm_big_mutex)) + +void ldbm_initialize( void ) +{ + static int initialized = 0; + + if(initialized++) return; + + pthread_mutex_init( &ldbm_big_mutex, pthread_mutexattr_default ); +} + /***************************************************************** * * * use gdbm * @@ -347,7 +398,10 @@ ldbm_open( char *name, int rw, int mode, int dbcachesize ) LDBM db; struct stat st; + LDBM_LOCK; + if ( (db = gdbm_open( name, 0, rw | GDBM_FAST, mode, 0 )) == NULL ) { + LDBM_UNLOCK; return( NULL ); } if ( dbcachesize > 0 && stat( name, &st ) == 0 ) { @@ -355,19 +409,24 @@ ldbm_open( char *name, int rw, int mode, int dbcachesize ) gdbm_setopt( db, GDBM_CACHESIZE, &dbcachesize, sizeof(int) ); } + LDBM_UNLOCK; return( db ); } void ldbm_close( LDBM ldbm ) { + LDBM_LOCK; gdbm_close( ldbm ); + LDBM_UNLOCK; } void ldbm_sync( LDBM ldbm ) { + LDBM_LOCK; gdbm_sync( ldbm ); + LDBM_UNLOCK; } void @@ -397,7 +456,11 @@ ldbm_datum_dup( LDBM ldbm, Datum data ) Datum ldbm_fetch( LDBM ldbm, Datum key ) { - return( gdbm_fetch( ldbm, key ) ); + Datum d; + LDBM_LOCK; + d = gdbm_fetch( ldbm, key ); + LDBM_UNLOCK; + return d; } int @@ -405,9 +468,11 @@ ldbm_store( LDBM ldbm, Datum key, Datum data, int flags ) { int rc; + LDBM_LOCK; rc = gdbm_store( ldbm, key, data, flags & ~LDBM_SYNC ); if ( flags & LDBM_SYNC ) gdbm_sync( ldbm ); + LDBM_UNLOCK; return( rc ); } @@ -416,31 +481,59 @@ ldbm_delete( LDBM ldbm, Datum key ) { int rc; + LDBM_LOCK; rc = gdbm_delete( ldbm, key ); gdbm_sync( ldbm ); + LDBM_UNLOCK; return( rc ); } Datum ldbm_firstkey( LDBM ldbm ) { - return( gdbm_firstkey( ldbm ) ); + Datum d; + LDBM_LOCK; + d = gdbm_firstkey( ldbm ); + LDBM_UNLOCK; + return d; } Datum ldbm_nextkey( LDBM ldbm, Datum key ) { - return( gdbm_nextkey( ldbm, key ) ); + Datum d; + LDBM_LOCK; + d = gdbm_nextkey( ldbm, key ); + LDBM_UNLOCK; + return d; } int ldbm_errno( LDBM ldbm ) { - return( (int) gdbm_errno ); + int err; + LDBM_LOCK; + err = gdbm_errno; + LDBM_UNLOCK; + return( err ); } #elif defined( HAVE_NDBM ) +/* GDBM is non-reentrant */ +static pthread_mutex_t ldbm_big_mutex; +#define LDBM_LOCK (pthread_mutex_lock(&ldbm_big_mutex)) +#define LDBM_UNLOCK (pthread_mutex_unlock(&ldbm_big_mutex)) + +void ldbm_initialize( void ) +{ + static int initialized = 0; + + if(initialized++) return; + + pthread_mutex_init( &ldbm_big_mutex, pthread_mutexattr_default ); +} + /***************************************************************** * * * if no gdbm, fall back to using ndbm, the standard unix thing * @@ -451,13 +544,21 @@ ldbm_errno( LDBM ldbm ) LDBM ldbm_open( char *name, int rw, int mode, int dbcachesize ) { - return( dbm_open( name, rw, mode ) ); + LDBM ldbm; + + LDBM_LOCK; + ldbm = dbm_open( name, rw, mode ); + LDBM_UNLOCK; + + return( ldbm ); } void ldbm_close( LDBM ldbm ) { + LDBM_LOCK; dbm_close( ldbm ); + LDBM_UNLOCK; } /* ARGSUSED */ @@ -495,37 +596,61 @@ ldbm_datum_dup( LDBM ldbm, Datum data ) Datum ldbm_fetch( LDBM ldbm, Datum key ) { - return( ldbm_datum_dup( ldbm, dbm_fetch( ldbm, key ) ) ); + Datum d; + LDBM_LOCK; + d = ldbm_datum_dup( ldbm, dbm_fetch( ldbm, key ) ); + LDBM_UNLOCK; + return d; } int ldbm_store( LDBM ldbm, Datum key, Datum data, int flags ) { - return( dbm_store( ldbm, key, data, flags ) ); + int rc; + LDBM_LOCK; + rc = dbm_store( ldbm, key, data, flags ); + LDBM_UNLOCK; + return rc; } int ldbm_delete( LDBM ldbm, Datum key ) { - return( dbm_delete( ldbm, key ) ); + int rc; + LDBM_LOCK; + rc = dbm_delete( ldbm, key ); + LDBM_UNLOCK; + return rc; } Datum ldbm_firstkey( LDBM ldbm ) { - return( dbm_firstkey( ldbm ) ); + Datum d; + LDBM_LOCK; + d = dbm_firstkey( ldbm ); + LDBM_UNLOCK; + return d; } Datum ldbm_nextkey( LDBM ldbm, Datum key ) { - return( dbm_nextkey( ldbm ) ); + Datum d; + LDBM_LOCK; + d = dbm_nextkey( ldbm ); + LDBM_UNLOCK; + return d; } int ldbm_errno( LDBM ldbm ) { - return( dbm_error( ldbm ) ); + int err; + LDBM_LOCK; + err = dbm_error( ldbm ); + LDBM_UNLOCK; + return err; } #endif /* ndbm */ diff --git a/servers/slapd/back-ldbm/back-ldbm.h b/servers/slapd/back-ldbm/back-ldbm.h index 5f46374c79..95b1134d00 100644 --- a/servers/slapd/back-ldbm/back-ldbm.h +++ b/servers/slapd/back-ldbm/back-ldbm.h @@ -71,16 +71,13 @@ struct cache { /* for the cache of open index files */ struct dbcache { - char *dbc_name; int dbc_refcnt; - time_t dbc_lastref; - pthread_mutex_t dbc_mutex; - pthread_cond_t dbc_cv; - int dbc_readers; - long dbc_blksize; int dbc_maxids; int dbc_maxindirect; - LDBM dbc_db; + time_t dbc_lastref; + long dbc_blksize; + char *dbc_name; + LDBM dbc_db; }; /* for the cache of attribute information (which are indexed, etc.) */ diff --git a/servers/slapd/back-ldbm/dbcache.c b/servers/slapd/back-ldbm/dbcache.c index 143ed07e3e..7254c6f4c0 100644 --- a/servers/slapd/back-ldbm/dbcache.c +++ b/servers/slapd/back-ldbm/dbcache.c @@ -160,9 +160,7 @@ ldbm_cache_flush_all( Backend *be ) if ( li->li_dbcache[i].dbc_name != NULL ) { Debug( LDAP_DEBUG_TRACE, "ldbm flushing db (%s)\n", li->li_dbcache[i].dbc_name, 0, 0 ); - pthread_mutex_lock( &li->li_dbcache[i].dbc_mutex ); ldbm_sync( li->li_dbcache[i].dbc_db ); - pthread_mutex_unlock( &li->li_dbcache[i].dbc_mutex ); } } pthread_mutex_unlock( &li->li_dbcache_mutex ); @@ -178,24 +176,8 @@ ldbm_cache_fetch( ldbm_datum_init( data ); - pthread_mutex_lock( &db->dbc_mutex ); -#ifdef reentrant_database - /* increment reader count */ - db->dbc_readers++ - pthread_mutex_unlock( &db->dbc_mutex ); -#endif - data = ldbm_fetch( db->dbc_db, key ); -#ifdef reentrant_database - pthread_mutex_lock( &db->dbc_mutex ); - /* decrement reader count & signal any waiting writers */ - if ( --db->dbc_readers == 0 ) { - pthread_cond_signal( &db->dbc_cv ); - } -#endif - pthread_mutex_unlock( &db->dbc_mutex ); - return( data ); } @@ -209,14 +191,6 @@ ldbm_cache_store( { int rc; - pthread_mutex_lock( &db->dbc_mutex ); -#ifdef reentrant_database - /* wait for reader count to drop to zero */ - while ( db->dbc_readers > 0 ) { - pthread_cond_wait( &db->dbc_cv, &db->dbc_mutex ); - } -#endif - #ifdef LDBM_DEBUG Statslog( LDAP_DEBUG_STATS, "=> ldbm_cache_store(): key.dptr=%s, key.dsize=%d\n", @@ -237,8 +211,6 @@ ldbm_cache_store( rc = ldbm_store( db->dbc_db, key, data, flags ); - pthread_mutex_unlock( &db->dbc_mutex ); - return( rc ); } @@ -250,17 +222,7 @@ ldbm_cache_delete( { int rc; - pthread_mutex_lock( &db->dbc_mutex ); -#ifdef reentrant_database - /* wait for reader count to drop to zero - then write */ - while ( db->dbc_readers > 0 ) { - pthread_cond_wait( &db->dbc_cv, &db->dbc_mutex ); - } -#endif - rc = ldbm_delete( db->dbc_db, key ); - pthread_mutex_unlock( &db->dbc_mutex ); - return( rc ); } diff --git a/servers/slapd/back-ldbm/init.c b/servers/slapd/back-ldbm/init.c index eccc6d2266..501e451880 100644 --- a/servers/slapd/back-ldbm/init.c +++ b/servers/slapd/back-ldbm/init.c @@ -19,9 +19,8 @@ ldbm_back_init( char *argv[ 4 ]; int i; -#ifdef HAVE_BERKELEY_DB2 - extern pthread_mutex_t dbEnvInit_mutex; -#endif + /* initialize the underlying database system */ + ldbm_initialize(); /* allocate backend-specific stuff */ li = (struct ldbminfo *) ch_calloc( 1, sizeof(struct ldbminfo) ); @@ -77,15 +76,6 @@ ldbm_back_init( pthread_mutex_init( &li->li_nextid_mutex, pthread_mutexattr_default ); pthread_mutex_init( &li->li_dbcache_mutex, pthread_mutexattr_default ); pthread_cond_init( &li->li_dbcache_cv, pthread_condattr_default ); - for ( i = 0; i < MAXDBCACHE; i++ ) { - pthread_mutex_init( &li->li_dbcache[i].dbc_mutex, - pthread_mutexattr_default ); - pthread_cond_init( &li->li_dbcache[i].dbc_cv, - pthread_condattr_default ); - } -#ifdef HAVE_BERKELEY_DB2 - pthread_mutex_init( &dbEnvInit_mutex, pthread_mutexattr_default ); -#endif be->be_private = li; } -- 2.47.2