]> git.sur5r.net Git - openldap/commitdiff
MegaCommit of locking update.
authorKurt Zeilenga <kurt@openldap.org>
Fri, 29 Jan 1999 06:11:40 +0000 (06:11 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 29 Jan 1999 06:11:40 +0000 (06:11 +0000)
use ldap_pvt_ routines (replacing old lthread impl)

65 files changed:
CHANGES
configure
configure.in
include/ldap_pvt_thread.h [new file with mode: 0644]
include/lthread.h [deleted file]
include/lthread_rdwr.h [deleted file]
include/portable.h.in
libraries/libldbm/ldbm.c
libraries/liblthread/Makefile.in
libraries/liblthread/rdwr.c
libraries/liblthread/stack.c [deleted file]
libraries/liblthread/thr_cthreads.c [new file with mode: 0644]
libraries/liblthread/thr_lwp.c [new file with mode: 0644]
libraries/liblthread/thr_nt.c [new file with mode: 0644]
libraries/liblthread/thr_posix.c [new file with mode: 0644]
libraries/liblthread/thr_sleep.c [new file with mode: 0644]
libraries/liblthread/thr_stub.c [new file with mode: 0644]
libraries/liblthread/thr_thr.c [new file with mode: 0644]
libraries/liblthread/thread.c [deleted file]
servers/slapd/abandon.c
servers/slapd/add.c
servers/slapd/back-ldbm/add.c
servers/slapd/back-ldbm/back-ldbm.h
servers/slapd/back-ldbm/bind.c
servers/slapd/back-ldbm/cache.c
servers/slapd/back-ldbm/dbcache.c
servers/slapd/back-ldbm/delete.c
servers/slapd/back-ldbm/id2entry.c
servers/slapd/back-ldbm/index.c
servers/slapd/back-ldbm/init.c
servers/slapd/back-ldbm/modify.c
servers/slapd/back-ldbm/modrdn.c
servers/slapd/back-ldbm/nextid.c
servers/slapd/back-ldbm/search.c
servers/slapd/back-passwd/search.c
servers/slapd/back-shell/abandon.c
servers/slapd/back-shell/add.c
servers/slapd/backend.c
servers/slapd/bind.c
servers/slapd/charray.c
servers/slapd/connection.c
servers/slapd/daemon.c
servers/slapd/entry.c
servers/slapd/init.c
servers/slapd/main.c
servers/slapd/modify.c
servers/slapd/monitor.c
servers/slapd/operation.c
servers/slapd/proto-slap.h
servers/slapd/repl.c
servers/slapd/result.c
servers/slapd/slap.h
servers/slurpd/Makefile.in
servers/slurpd/fm.c
servers/slurpd/globals.c
servers/slurpd/globals.h
servers/slurpd/main.c
servers/slurpd/re.c
servers/slurpd/reject.c
servers/slurpd/replica.c
servers/slurpd/ri.c
servers/slurpd/rq.c
servers/slurpd/slurp.h
servers/slurpd/st.c
servers/slurpd/tsleep.c [deleted file]

diff --git a/CHANGES b/CHANGES
index a3c32a0be045bddcc5cd21a33a1a0a0e06649368..76f6cc411f95d039a4fd947fe62964198afca7af 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,8 +4,10 @@ Changes included in OpenLDAP 1.2
        CVS Tag: OPENLDAP_REL_ENG_1_2
        Fixed slapd/ldbm/add cache set state deadlock bug
        Fixed slapd/ldbm/add,modrdn,delete e_ndn handling
-       Update ldap_open(3) man page to note ldap_init() is preferred.
+       Updated ldap_open(3) man page to note ldap_init() is preferred.
+       Updated internal thread library
        Build environment
+               Fixed --without-threads building
                Fixed mkdep to handle multiple dependent files on one line
                Fixed openldap.m4 to "protect" shell variable
                Fixed HAVE_PHREAD_FINAL typo
index eef21dc8ef786f8a785085a5f3a929c0ae395005..076a57f8df7d04b29e2f79fa31722e0a2fa1aecc 100755 (executable)
--- a/configure
+++ b/configure
@@ -30,6 +30,8 @@ ac_help="$ac_help
   --enable-cldap       enable connectionless ldap (no)"
 ac_help="$ac_help
   --enable-x-compile   enable cross compiling (no)"
+ac_help="$ac_help
+  --enable-dmalloc     enable debug malloc support (no)"
 ac_help="$ac_help
   --with-kerberos      use Kerberos (auto)"
 ac_help="$ac_help
@@ -617,7 +619,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:621: checking for a BSD compatible install" >&5
+echo "configure:623: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -670,7 +672,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:674: checking whether build environment is sane" >&5
+echo "configure:676: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -727,7 +729,7 @@ test "$program_suffix" != NONE &&
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:731: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:733: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -766,7 +768,7 @@ fi
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:770: checking for working aclocal" >&5
+echo "configure:772: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -779,7 +781,7 @@ else
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:783: checking for working autoconf" >&5
+echo "configure:785: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -792,7 +794,7 @@ else
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:796: checking for working automake" >&5
+echo "configure:798: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -805,7 +807,7 @@ else
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:809: checking for working autoheader" >&5
+echo "configure:811: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -818,7 +820,7 @@ else
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:822: checking for working makeinfo" >&5
+echo "configure:824: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -834,7 +836,7 @@ fi
 
 
 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
-echo "configure:838: checking configure arguments" >&5
+echo "configure:840: checking configure arguments" >&5
 
 
 top_builddir=`pwd`
@@ -1015,6 +1017,27 @@ else
 fi
 # end --enable-x_compile
 
+# OpenLDAP --enable-dmalloc
+       # Check whether --enable-dmalloc or --disable-dmalloc was given.
+if test "${enable_dmalloc+set}" = set; then
+  enableval="$enable_dmalloc"
+  
+       ol_arg=invalid
+       for ol_val in auto yes no ; do
+               if test "$enableval" = "$ol_val" ; then
+                       ol_arg="$ol_val"
+               fi
+       done
+       if test "$ol_arg" = "invalid" ; then
+               { echo "configure: error: bad value $enableval for --enable-dmalloc" 1>&2; exit 1; }
+       fi
+       ol_enable_dmalloc="$ol_arg"
+
+else
+       ol_enable_dmalloc="no"
+fi
+# end --enable-dmalloc
+
 # OpenLDAP --with-kerberos
        # Check whether --with-kerberos or --without-kerberos was given.
 if test "${with_kerberos+set}" = set; then
@@ -1534,7 +1557,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1538: checking host system type" >&5
+echo "configure:1561: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -1589,7 +1612,7 @@ TERMCAP_LIBS=
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1593: checking for a BSD compatible install" >&5
+echo "configure:1616: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1641,7 +1664,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1645: checking for $ac_word" >&5
+echo "configure:1668: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1670,7 +1693,7 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1674: checking for $ac_word" >&5
+echo "configure:1697: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1699,7 +1722,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1703: checking for $ac_word" >&5
+echo "configure:1726: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1747,7 +1770,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1751: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1774: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1757,11 +1780,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
 cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext <<EOF
-#line 1761 "configure"
+#line 1784 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:1765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1781,12 +1804,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1785: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1808: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1790: checking whether we are using GNU C" >&5
+echo "configure:1813: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1795,7 +1818,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1799: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1810,7 +1833,7 @@ if test $ac_cv_prog_gcc = yes; then
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1814: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1837: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1850,7 +1873,7 @@ ac_prog=ld
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1854: checking for ld used by GCC" >&5
+echo "configure:1877: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
   # Accept absolute paths.
@@ -1868,10 +1891,10 @@ echo "configure:1854: checking for ld used by GCC" >&5
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1872: checking for GNU ld" >&5
+echo "configure:1895: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1875: checking for non-GNU ld" >&5
+echo "configure:1898: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1907,7 +1930,7 @@ fi
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1911: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1934: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1923,7 +1946,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1927: checking for BSD-compatible nm" >&5
+echo "configure:1950: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1960,7 +1983,7 @@ echo "$ac_t""$NM" 1>&6
 
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1964: checking whether ln -s works" >&5
+echo "configure:1987: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1996,8 +2019,8 @@ test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 2000 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:2001: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 2023 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:2024: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -2030,7 +2053,7 @@ $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
 # Extract the first word of "sendmail", so it can be a program name with args.
 set dummy sendmail; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2034: checking for $ac_word" >&5
+echo "configure:2057: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2062,7 +2085,7 @@ fi
 # Extract the first word of "vi", so it can be a program name with args.
 set dummy vi; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2066: checking for $ac_word" >&5
+echo "configure:2089: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2094,7 +2117,7 @@ fi
 # Extract the first word of "finger", so it can be a program name with args.
 set dummy finger; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2098: checking for $ac_word" >&5
+echo "configure:2121: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2138,7 +2161,7 @@ elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2142: checking how to run the C preprocessor" >&5
+echo "configure:2165: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -2153,13 +2176,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 2157 "configure"
+#line 2180 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2163: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -2170,13 +2193,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 2174 "configure"
+#line 2197 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2180: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2203: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -2200,9 +2223,9 @@ echo "$ac_t""$CPP" 1>&6
 
 
 echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:2204: checking for AIX" >&5
+echo "configure:2227: checking for AIX" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2206 "configure"
+#line 2229 "configure"
 #include "confdefs.h"
 #ifdef _AIX
   yes
@@ -2224,7 +2247,7 @@ rm -f conftest*
 
 
 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:2228: checking for POSIXized ISC" >&5
+echo "configure:2251: checking for POSIXized ISC" >&5
 if test -d /etc/conf/kconfig.d &&
   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
 then
@@ -2246,17 +2269,17 @@ fi
 
 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
-echo "configure:2250: checking for minix/config.h" >&5
+echo "configure:2273: checking for minix/config.h" >&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
-#line 2255 "configure"
+#line 2278 "configure"
 #include "confdefs.h"
 #include <minix/config.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2260: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2298,7 +2321,7 @@ fi
 
 
 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:2302: checking for ${CC-cc} option to accept ANSI C" >&5
+echo "configure:2325: checking for ${CC-cc} option to accept ANSI C" >&5
 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2314,7 +2337,7 @@ for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__
 do
   CC="$ac_save_CC $ac_arg"
   cat > conftest.$ac_ext <<EOF
-#line 2318 "configure"
+#line 2341 "configure"
 #include "confdefs.h"
 #include <stdarg.h>
 #include <stdio.h>
@@ -2351,7 +2374,7 @@ return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
 
 ; return 0; }
 EOF
-if { (eval echo configure:2355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_prog_cc_stdc="$ac_arg"; break
 else
@@ -2382,12 +2405,12 @@ fi
 
 
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:2386: checking for socket" >&5
+echo "configure:2409: checking for socket" >&5
 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2391 "configure"
+#line 2414 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -2410,7 +2433,7 @@ socket();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_socket=yes"
 else
@@ -2429,7 +2452,7 @@ else
   echo "$ac_t""no" 1>&6
        
        echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
-echo "configure:2433: checking for main in -lsocket" >&5
+echo "configure:2456: checking for main in -lsocket" >&5
 ac_lib_var=`echo socket'_'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
@@ -2437,14 +2460,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2441 "configure"
+#line 2464 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2471: \"$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
@@ -2472,7 +2495,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
-echo "configure:2476: checking for main in -lnet" >&5
+echo "configure:2499: checking for main in -lnet" >&5
 ac_lib_var=`echo net'_'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
@@ -2480,14 +2503,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2484 "configure"
+#line 2507 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2514: \"$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
@@ -2515,7 +2538,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
-echo "configure:2519: checking for main in -lnsl_s" >&5
+echo "configure:2542: checking for main in -lnsl_s" >&5
 ac_lib_var=`echo nsl_s'_'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
@@ -2523,14 +2546,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2527 "configure"
+#line 2550 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2557: \"$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
@@ -2558,7 +2581,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:2562: checking for main in -lnsl" >&5
+echo "configure:2585: checking for main in -lnsl" >&5
 ac_lib_var=`echo nsl'_'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
@@ -2566,14 +2589,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2570 "configure"
+#line 2593 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2600: \"$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
@@ -2601,7 +2624,7 @@ else
 fi
 
        echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
-echo "configure:2605: checking for socket in -linet" >&5
+echo "configure:2628: checking for socket in -linet" >&5
 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2609,7 +2632,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-linet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2613 "configure"
+#line 2636 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2620,7 +2643,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:2624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2647: \"$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
@@ -2648,7 +2671,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
-echo "configure:2652: checking for main in -lgen" >&5
+echo "configure:2675: checking for main in -lgen" >&5
 ac_lib_var=`echo gen'_'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
@@ -2656,14 +2679,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgen  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2660 "configure"
+#line 2683 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2690: \"$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
@@ -2697,12 +2720,12 @@ fi
 for ac_func in res_search
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2701: checking for $ac_func" >&5
+echo "configure:2724: 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 <<EOF
-#line 2706 "configure"
+#line 2729 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2725,7 +2748,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2751,7 +2774,7 @@ done
 
 if test $ac_cv_func_res_search = "no" ; then 
        echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
-echo "configure:2755: checking for res_search in -lbind" >&5
+echo "configure:2778: checking for res_search in -lbind" >&5
 ac_lib_var=`echo bind'_'res_search | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2759,7 +2782,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbind  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2763 "configure"
+#line 2786 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2770,7 +2793,7 @@ int main() {
 res_search()
 ; return 0; }
 EOF
-if { (eval echo configure:2774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2797: \"$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
@@ -2804,7 +2827,7 @@ EOF
 
        else
                echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
-echo "configure:2808: checking for res_search in -lresolv" >&5
+echo "configure:2831: checking for res_search in -lresolv" >&5
 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2812,7 +2835,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2816 "configure"
+#line 2839 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2823,7 +2846,7 @@ int main() {
 res_search()
 ; return 0; }
 EOF
-if { (eval echo configure:2827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2850: \"$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
@@ -2860,7 +2883,7 @@ EOF
 fi
 
 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
-echo "configure:2864: checking for sigset in -lV3" >&5
+echo "configure:2887: checking for sigset in -lV3" >&5
 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2868,7 +2891,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lV3  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2872 "configure"
+#line 2895 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2879,7 +2902,7 @@ int main() {
 sigset()
 ; return 0; }
 EOF
-if { (eval echo configure:2883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2906: \"$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
@@ -2911,7 +2934,7 @@ fi
 ol_link_isode=no
 if test $ol_enable_ldapd != no ; then
                echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
-echo "configure:2915: checking for main in -lxtpp" >&5
+echo "configure:2938: checking for main in -lxtpp" >&5
 ac_lib_var=`echo xtpp'_'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
@@ -2919,14 +2942,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2923 "configure"
+#line 2946 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2953: \"$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
@@ -2955,7 +2978,7 @@ else
 fi
 
        echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
-echo "configure:2959: checking for main in -ldsap" >&5
+echo "configure:2982: checking for main in -ldsap" >&5
 ac_lib_var=`echo dsap'_'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
@@ -2963,14 +2986,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldsap -lisode $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2967 "configure"
+#line 2990 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2997: \"$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
@@ -2999,7 +3022,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
-echo "configure:3003: checking for main in -lisode" >&5
+echo "configure:3026: checking for main in -lisode" >&5
 ac_lib_var=`echo isode'_'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
@@ -3007,14 +3030,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lisode  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3011 "configure"
+#line 3034 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3041: \"$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
@@ -3046,7 +3069,7 @@ fi
 
 if test $ol_link_isode != no; then
        echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
-echo "configure:3050: checking for main in -lpp" >&5
+echo "configure:3073: checking for main in -lpp" >&5
 ac_lib_var=`echo pp'_'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
@@ -3054,14 +3077,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpp  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3058 "configure"
+#line 3081 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3088: \"$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
@@ -3092,7 +3115,7 @@ fi
        # Extract the first word of "pepsy", so it can be a program name with args.
 set dummy pepsy; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3096: checking for $ac_word" >&5
+echo "configure:3119: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PEPSY'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3129,17 +3152,17 @@ if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3133: checking for $ac_hdr" >&5
+echo "configure:3156: 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
-#line 3138 "configure"
+#line 3161 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3143: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3166: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3168,7 +3191,7 @@ done
 
        if test $ac_cv_header_kerberosIV_krb_h = yes ; then
                echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
-echo "configure:3172: checking for main in -lkrb4" >&5
+echo "configure:3195: checking for main in -lkrb4" >&5
 ac_lib_var=`echo krb4'_'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
@@ -3176,14 +3199,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3180 "configure"
+#line 3203 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3210: \"$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
@@ -3223,17 +3246,17 @@ if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3227: checking for $ac_hdr" >&5
+echo "configure:3250: 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
-#line 3232 "configure"
+#line 3255 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3237: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3260: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3262,7 +3285,7 @@ done
 
        if test $ac_cv_header_krb_h = yes ; then
                echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
-echo "configure:3266: checking for main in -lkrb" >&5
+echo "configure:3289: checking for main in -lkrb" >&5
 ac_lib_var=`echo krb'_'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
@@ -3270,14 +3293,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb -ldes $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3274 "configure"
+#line 3297 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3304: \"$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
@@ -3321,17 +3344,17 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3325: checking for $ac_hdr" >&5
+echo "configure:3348: 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
-#line 3330 "configure"
+#line 3353 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3335: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3358: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3360,13 +3383,13 @@ done
 
        if test $ac_cv_header_pthread_h = yes ; then
                echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
-echo "configure:3364: checking POSIX thread version" >&5
+echo "configure:3387: checking POSIX thread version" >&5
 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 3370 "configure"
+#line 3393 "configure"
 #include "confdefs.h"
 
 #              include <pthread.h>
@@ -3388,7 +3411,7 @@ rm -f conftest*
 
 
        cat > conftest.$ac_ext <<EOF
-#line 3392 "configure"
+#line 3415 "configure"
 #include "confdefs.h"
 
 #              include <pthread.h>
@@ -3441,7 +3464,7 @@ EOF
 
                
 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
-echo "configure:3445: checking for LinuxThreads" >&5
+echo "configure:3468: checking for LinuxThreads" >&5
 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3467,12 +3490,12 @@ EOF
 
                
                                echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
-echo "configure:3471: checking for pthread_create" >&5
+echo "configure:3494: checking for pthread_create" >&5
 if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3476 "configure"
+#line 3499 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char pthread_create(); below.  */
@@ -3495,7 +3518,7 @@ pthread_create();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_pthread_create=yes"
 else
@@ -3517,7 +3540,7 @@ fi
 
                if test $ol_link_threads = no ; then
                                                echo $ac_n "checking for pthread_create with -kthread""... $ac_c" 1>&6
-echo "configure:3521: checking for pthread_create with -kthread" >&5
+echo "configure:3544: checking for pthread_create with -kthread" >&5
 if eval "test \"`echo '$''{'ol_cv_kthread_flag'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3525,7 +3548,7 @@ else
                                                                save_LIBS="$LIBS"
                                LIBS="-kthread $LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 3529 "configure"
+#line 3552 "configure"
 #include "confdefs.h"
 char pthread();
 int main() {
@@ -3534,7 +3557,7 @@ int main() {
                                        
 ; return 0; }
 EOF
-if { (eval echo configure:3538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ol_cv_kthread_flag=yes
 else
@@ -3558,7 +3581,7 @@ echo "$ac_t""$ol_cv_kthread_flag" 1>&6
 
                if test $ol_link_threads = no ; then
                                                echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6
-echo "configure:3562: checking for pthread_create with -pthread" >&5
+echo "configure:3585: checking for pthread_create with -pthread" >&5
 if eval "test \"`echo '$''{'ol_cv_pthread_flag'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3566,7 +3589,7 @@ else
                                                                save_LIBS="$LIBS"
                                LIBS="-pthread $LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 3570 "configure"
+#line 3593 "configure"
 #include "confdefs.h"
 char pthread();
 int main() {
@@ -3575,7 +3598,7 @@ int main() {
                                        
 ; return 0; }
 EOF
-if { (eval echo configure:3579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ol_cv_pthread_flag=yes
 else
@@ -3599,7 +3622,7 @@ echo "$ac_t""$ol_cv_pthread_flag" 1>&6
 
                if test $ol_link_threads = no ; then
                                                echo $ac_n "checking for pthread_create with -pthreads""... $ac_c" 1>&6
-echo "configure:3603: checking for pthread_create with -pthreads" >&5
+echo "configure:3626: checking for pthread_create with -pthreads" >&5
 if eval "test \"`echo '$''{'ol_cv_pthreads_flag'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3607,7 +3630,7 @@ else
                                                                save_LIBS="$LIBS"
                                LIBS="-pthreads $LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 3611 "configure"
+#line 3634 "configure"
 #include "confdefs.h"
 char pthread();
 int main() {
@@ -3616,7 +3639,7 @@ int main() {
                                        
 ; return 0; }
 EOF
-if { (eval echo configure:3620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ol_cv_pthreads_flag=yes
 else
@@ -3640,7 +3663,7 @@ echo "$ac_t""$ol_cv_pthreads_flag" 1>&6
 
                if test $ol_link_threads = no ; then
                                                echo $ac_n "checking for pthread_create with -thread""... $ac_c" 1>&6
-echo "configure:3644: checking for pthread_create with -thread" >&5
+echo "configure:3667: checking for pthread_create with -thread" >&5
 if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3648,7 +3671,7 @@ else
                                                                save_LIBS="$LIBS"
                                LIBS="-thread $LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 3652 "configure"
+#line 3675 "configure"
 #include "confdefs.h"
 char pthread();
 int main() {
@@ -3657,7 +3680,7 @@ int main() {
                                        
 ; return 0; }
 EOF
-if { (eval echo configure:3661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ol_cv_thread_flag=yes
 else
@@ -3682,7 +3705,7 @@ echo "$ac_t""$ol_cv_thread_flag" 1>&6
                if test $ol_link_threads = no ; then
                                                save_LIBS="$LIBS"
                        echo $ac_n "checking for pthread_mutex_lock in -lpthread""... $ac_c" 1>&6
-echo "configure:3686: checking for pthread_mutex_lock in -lpthread" >&5
+echo "configure:3709: checking for pthread_mutex_lock in -lpthread" >&5
 ac_lib_var=`echo pthread'_'pthread_mutex_lock | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3690,7 +3713,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthread -lexc $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3694 "configure"
+#line 3717 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3701,7 +3724,7 @@ int main() {
 pthread_mutex_lock()
 ; return 0; }
 EOF
-if { (eval echo configure:3705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3728: \"$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
@@ -3734,7 +3757,7 @@ fi
                if test $ol_link_threads = no ; then
                                                save_LIBS="$LIBS"
                        echo $ac_n "checking for pthread_mutex_unlock in -lpthreads""... $ac_c" 1>&6
-echo "configure:3738: checking for pthread_mutex_unlock in -lpthreads" >&5
+echo "configure:3761: checking for pthread_mutex_unlock in -lpthreads" >&5
 ac_lib_var=`echo pthreads'_'pthread_mutex_unlock | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3742,7 +3765,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3746 "configure"
+#line 3769 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3753,7 +3776,7 @@ int main() {
 pthread_mutex_unlock()
 ; return 0; }
 EOF
-if { (eval echo configure:3757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3780: \"$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
@@ -3786,7 +3809,7 @@ fi
                if test $ol_link_threads = no ; then
                                                save_LIBS="$LIBS"
                        echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:3790: checking for pthread_create in -lpthread" >&5
+echo "configure:3813: checking for pthread_create in -lpthread" >&5
 ac_lib_var=`echo pthread'_'pthread_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
@@ -3794,7 +3817,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3798 "configure"
+#line 3821 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3805,7 +3828,7 @@ int main() {
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:3809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3832: \"$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
@@ -3834,7 +3857,7 @@ fi
                if test $ol_link_threads = no ; then
                                                save_LIBS="$LIBS"
                        echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
-echo "configure:3838: checking for pthread_create in -lc_r" >&5
+echo "configure:3861: checking for pthread_create in -lc_r" >&5
 ac_lib_var=`echo c_r'_'pthread_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
@@ -3842,7 +3865,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lc_r  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3846 "configure"
+#line 3869 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3853,7 +3876,7 @@ int main() {
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:3857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3880: \"$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
@@ -3882,7 +3905,7 @@ fi
                if test $ol_link_threads = no ; then
                                                save_LIBS="$LIBS"
                        echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
-echo "configure:3886: checking for pthread_create in -lpthreads" >&5
+echo "configure:3909: checking for pthread_create in -lpthreads" >&5
 ac_lib_var=`echo pthreads'_'pthread_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
@@ -3890,7 +3913,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthreads  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3894 "configure"
+#line 3917 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3901,7 +3924,7 @@ int main() {
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:3905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3928: \"$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
@@ -3930,7 +3953,7 @@ fi
                                if test $ol_link_threads = no ; then
                                                save_LIBS="$LIBS"
                        echo $ac_n "checking for pthread_join in -lpthreads""... $ac_c" 1>&6
-echo "configure:3934: checking for pthread_join in -lpthreads" >&5
+echo "configure:3957: checking for pthread_join in -lpthreads" >&5
 ac_lib_var=`echo pthreads'_'pthread_join | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3938,7 +3961,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthreads -Wl,-woff,85 $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3942 "configure"
+#line 3965 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3949,7 +3972,7 @@ int main() {
 pthread_join()
 ; return 0; }
 EOF
-if { (eval echo configure:3953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3976: \"$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
@@ -3980,14 +4003,14 @@ fi
                        save_LIBS="$LIBS"
                        LIBS="$LIBS -lpthread"
                        echo $ac_n "checking for pthread_create() in HP-UX -lpthread""... $ac_c" 1>&6
-echo "configure:3984: checking for pthread_create() in HP-UX -lpthread" >&5
+echo "configure:4007: checking for pthread_create() in HP-UX -lpthread" >&5
                        ol_try_pthread_hpux_11=no
                        if eval "test \"`echo '$''{'ol_cv_pthread_hpux_11'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                                cat > conftest.$ac_ext <<EOF
-#line 3991 "configure"
+#line 4014 "configure"
 #include "confdefs.h"
 
 #include <pthread.h>
@@ -4000,7 +4023,7 @@ int main() {
 pthread_create(NULL, NULL, NULL, NULL);
 ; return 0; }
 EOF
-if { (eval echo configure:4004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ol_try_pthread_hpux_11=yes
                                        ol_cv_pthread_hpux_11=yes
@@ -4038,12 +4061,12 @@ EOF
                                                                                                for ac_func in sched_yield pthread_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4042: checking for $ac_func" >&5
+echo "configure:4065: 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 <<EOF
-#line 4047 "configure"
+#line 4070 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4066,7 +4089,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4094,7 +4117,7 @@ done
                        if test $ac_cv_func_sched_yield = no -a \
                                $ac_cv_func_pthread_yield = no ; then
                                                                echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
-echo "configure:4098: checking for sched_yield in -lrt" >&5
+echo "configure:4121: checking for sched_yield in -lrt" >&5
 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4102,7 +4125,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lrt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4106 "configure"
+#line 4129 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4113,7 +4136,7 @@ int main() {
 sched_yield()
 ; return 0; }
 EOF
-if { (eval echo configure:4117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4140: \"$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
@@ -4142,67 +4165,15 @@ fi
                        fi
                        if test $ac_cv_func_sched_yield = no -a \
                                $ac_cv_func_pthread_yield = no ; then
-                                                               echo $ac_n "checking for sched_yield in -lposix4""... $ac_c" 1>&6
-echo "configure:4147: checking for sched_yield in -lposix4" >&5
-ac_lib_var=`echo posix4'_'sched_yield | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lposix4  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4155 "configure"
-#include "confdefs.h"
-/* 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 sched_yield();
-
-int main() {
-sched_yield()
-; return 0; }
-EOF
-if { (eval echo configure:4166: \"$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
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  LTHREAD_LIBS="$LTHREAD_LIBS -lposix4"
-                                       cat >> confdefs.h <<\EOF
-#define HAVE_SCHED_YIELD 1
-EOF
-
-                                       ac_cv_func_sched_yield=yes
-else
-  echo "$ac_t""no" 1>&6
-ac_cv_func_sched_yield=no
-fi
-
-                       fi
-                       if test $ac_cv_func_sched_yield = no -a \
-                               $ac_cv_func_pthread_yield = no ; then
-                               echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
-                       fi
-
-                                               for ac_func in pthread_kill pthread_detach
+                                                                                               for ac_func in thr_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4201: checking for $ac_func" >&5
+echo "configure:4172: 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 <<EOF
-#line 4206 "configure"
+#line 4177 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4225,7 +4196,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4249,20 +4220,22 @@ else
 fi
 done
 
+                       fi
+                       if test $ac_cv_func_sched_yield = no -a \
+                               $ac_cv_func_pthread_yield = no -a \
+                               "$ac_cv_func_thr_yield" = no ; then
+                               echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
+                       fi
 
-                       for ac_func in \
-                               pthread_attr_create pthread_attr_init \
-                               pthread_attr_destroy pthread_attr_delete \
-                               pthread_attr_setdetachstate pthread_attr_setdetach_np \
-                       
+                                               for ac_func in pthread_kill pthread_detach
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4261: checking for $ac_func" >&5
+echo "configure:4234: 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 <<EOF
-#line 4266 "configure"
+#line 4239 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4285,7 +4258,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4310,18 +4283,24 @@ fi
 done
 
 
+                       if test $ac_cv_func_pthread_detach = no ; then
+                               { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
+                       fi
+
                                                for ac_func in \
                                pthread_setconcurrency \
+                               pthread_getconcurrency \
                                thr_setconcurrency \
+                               thr_getconcurrency \
                        
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4320: checking for $ac_func" >&5
+echo "configure:4299: 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 <<EOF
-#line 4325 "configure"
+#line 4304 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4344,7 +4323,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4370,7 +4349,7 @@ done
 
 
                        echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
-echo "configure:4374: checking if pthread_create() works" >&5
+echo "configure:4353: checking if pthread_create() works" >&5
                        if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4379,7 +4358,7 @@ else
                                ol_cv_pthread_create_works=yes
 else
   cat > conftest.$ac_ext <<EOF
-#line 4383 "configure"
+#line 4362 "configure"
 #include "confdefs.h"
 
 #include <pthread.h>
@@ -4402,7 +4381,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:4406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_create_works=yes
 else
@@ -4424,7 +4403,7 @@ fi
 
                                                if test $ol_with_yielding_select = auto ; then
                                echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
-echo "configure:4428: checking if select yields when using pthreads" >&5
+echo "configure:4407: checking if select yields when using pthreads" >&5
                                if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4434,7 +4413,7 @@ else
                                { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 4438 "configure"
+#line 4417 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -4506,7 +4485,7 @@ int main(argc, argv)
        exit(2);
 }
 EOF
-if { (eval echo configure:4510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_select_yields=no
 else
@@ -4546,17 +4525,17 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4550: checking for $ac_hdr" >&5
+echo "configure:4529: 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
-#line 4555 "configure"
+#line 4534 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4560: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4539: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4586,12 +4565,12 @@ done
                ol_with_threads=found
 
                                echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
-echo "configure:4590: checking for cthread_fork" >&5
+echo "configure:4569: checking for cthread_fork" >&5
 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4595 "configure"
+#line 4574 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char cthread_fork(); below.  */
@@ -4614,7 +4593,7 @@ cthread_fork();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_cthread_fork=yes"
 else
@@ -4636,7 +4615,7 @@ fi
 
                if test $ol_link_threads = no ; then
                                                                        echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
-echo "configure:4640: checking for cthread_fork with -all_load" >&5
+echo "configure:4619: checking for cthread_fork with -all_load" >&5
 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4644,7 +4623,7 @@ else
                                                                save_LIBS="$LIBS"
                                LIBS="-all_load $LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 4648 "configure"
+#line 4627 "configure"
 #include "confdefs.h"
 #include <mach/cthreads.h>
 int main() {
@@ -4653,7 +4632,7 @@ int main() {
                                        
 ; return 0; }
 EOF
-if { (eval echo configure:4657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ol_cv_cthread_all_load=yes
 else
@@ -4698,17 +4677,17 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4702: checking for $ac_hdr" >&5
+echo "configure:4681: 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
-#line 4707 "configure"
+#line 4686 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4712: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4691: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4736,7 +4715,7 @@ done
 
        if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
                echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
-echo "configure:4740: checking for thr_create in -lthread" >&5
+echo "configure:4719: checking for thr_create in -lthread" >&5
 ac_lib_var=`echo thread'_'thr_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
@@ -4744,7 +4723,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4748 "configure"
+#line 4727 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4755,7 +4734,7 @@ int main() {
 thr_create()
 ; return 0; }
 EOF
-if { (eval echo configure:4759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4738: \"$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
@@ -4795,12 +4774,12 @@ EOF
                        
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4799: checking for $ac_func" >&5
+echo "configure:4778: 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 <<EOF
-#line 4804 "configure"
+#line 4783 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4823,7 +4802,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4854,17 +4833,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4858: checking for $ac_hdr" >&5
+echo "configure:4837: 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
-#line 4863 "configure"
+#line 4842 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4868: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4847: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4892,7 +4871,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:4896: checking for lwp_create in -llwp" >&5
+echo "configure:4875: 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
@@ -4900,7 +4879,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-llwp  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4904 "configure"
+#line 4883 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4911,7 +4890,7 @@ int main() {
 lwp_create()
 ; return 0; }
 EOF
-if { (eval echo configure:4915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4894: \"$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
@@ -4964,17 +4943,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:4968: checking for $ac_hdr" >&5
+echo "configure:4947: 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
-#line 4973 "configure"
+#line 4952 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4957: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5003,12 +4982,12 @@ done
        for ac_func in sched_yield pthread_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5007: checking for $ac_func" >&5
+echo "configure:4986: 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 <<EOF
-#line 5012 "configure"
+#line 4991 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5031,7 +5010,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5057,7 +5036,7 @@ done
 
        
 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
-echo "configure:5061: checking for LinuxThreads" >&5
+echo "configure:5040: checking for LinuxThreads" >&5
 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5078,17 +5057,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:5082: checking for $ac_hdr" >&5
+echo "configure:5061: 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
-#line 5087 "configure"
+#line 5066 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5118,17 +5097,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5122: checking for $ac_hdr" >&5
+echo "configure:5101: 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
-#line 5127 "configure"
+#line 5106 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5132: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5158,17 +5137,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5162: checking for $ac_hdr" >&5
+echo "configure:5141: 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
-#line 5167 "configure"
+#line 5146 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5151: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5223,13 +5202,13 @@ EOF
 
 
                                        echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
-echo "configure:5227: checking for thread specific errno" >&5
+echo "configure:5206: 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 <<EOF
-#line 5233 "configure"
+#line 5212 "configure"
 #include "confdefs.h"
 
 #include <errno.h>
@@ -5240,7 +5219,7 @@ int x = errno;
                        
 ; return 0; }
 EOF
-if { (eval echo configure:5244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ol_cv_errno_thread_specific=yes
 else
@@ -5282,13 +5261,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:5286: checking for DB2 library" >&5
+echo "configure:5265: 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:5292: checking for db_open in -ldb" >&5
+echo "configure:5271: 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
@@ -5296,7 +5275,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldb  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5300 "configure"
+#line 5279 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5307,7 +5286,7 @@ int main() {
 db_open()
 ; return 0; }
 EOF
-if { (eval echo configure:5311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5290: \"$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
@@ -5338,17 +5317,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:5342: checking for $ac_hdr" >&5
+echo "configure:5321: 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
-#line 5347 "configure"
+#line 5326 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5352: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5331: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5376,13 +5355,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:5380: checking if db.h is DB2" >&5
+echo "configure:5359: 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 <<EOF
-#line 5386 "configure"
+#line 5365 "configure"
 #include "confdefs.h"
 
 #                      include <db.h>
@@ -5414,7 +5393,7 @@ fi
 
  
  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
-echo "configure:5418: checking for Berkeley DB2" >&5
+echo "configure:5397: 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
@@ -5460,18 +5439,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:5464: checking for Berkeley DB library" >&5
+echo "configure:5443: 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:5470: checking for dbopen" >&5
+echo "configure:5449: 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 <<EOF
-#line 5475 "configure"
+#line 5454 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbopen(); below.  */
@@ -5494,7 +5473,7 @@ dbopen();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbopen=yes"
 else
@@ -5513,7 +5492,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
-echo "configure:5517: checking for dbopen in -ldb" >&5
+echo "configure:5496: 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
@@ -5521,7 +5500,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldb  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5525 "configure"
+#line 5504 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5532,7 +5511,7 @@ int main() {
 dbopen()
 ; return 0; }
 EOF
-if { (eval echo configure:5536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5515: \"$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
@@ -5567,17 +5546,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:5571: checking for $ac_hdr" >&5
+echo "configure:5550: 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
-#line 5576 "configure"
+#line 5555 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5581: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5560: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5613,7 +5592,7 @@ fi
 
  
  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
-echo "configure:5617: checking for Berkeley DB" >&5
+echo "configure:5596: 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
@@ -5666,17 +5645,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:5670: checking for $ac_hdr" >&5
+echo "configure:5649: 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
-#line 5675 "configure"
+#line 5654 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5659: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5711,18 +5690,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:5715: checking for GDBM library" >&5
+echo "configure:5694: 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:5721: checking for gdbm_open" >&5
+echo "configure:5700: 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 <<EOF
-#line 5726 "configure"
+#line 5705 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gdbm_open(); below.  */
@@ -5745,7 +5724,7 @@ gdbm_open();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_gdbm_open=yes"
 else
@@ -5764,7 +5743,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:5768: checking for gdbm_open in -lgdbm" >&5
+echo "configure:5747: 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
@@ -5772,7 +5751,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgdbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5776 "configure"
+#line 5755 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5783,7 +5762,7 @@ int main() {
 gdbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:5787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5766: \"$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
@@ -5818,17 +5797,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:5822: checking for $ac_hdr" >&5
+echo "configure:5801: 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
-#line 5827 "configure"
+#line 5806 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5811: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5855,7 +5834,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:5859: checking for db" >&5
+echo "configure:5838: checking for db" >&5
 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5891,18 +5870,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:5895: checking for NDBM library" >&5
+echo "configure:5874: 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:5901: checking for dbm_open" >&5
+echo "configure:5880: 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 <<EOF
-#line 5906 "configure"
+#line 5885 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -5925,7 +5904,7 @@ dbm_open();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbm_open=yes"
 else
@@ -5944,7 +5923,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
-echo "configure:5948: checking for dbm_open in -lndbm" >&5
+echo "configure:5927: 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
@@ -5952,7 +5931,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lndbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5956 "configure"
+#line 5935 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5963,7 +5942,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:5967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5946: \"$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
@@ -5983,7 +5962,7 @@ else
   echo "$ac_t""no" 1>&6
 
                        echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:5987: checking for dbm_open in -ldbm" >&5
+echo "configure:5966: 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
@@ -5991,7 +5970,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5995 "configure"
+#line 5974 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6002,7 +5981,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:6006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5985: \"$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
@@ -6039,17 +6018,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:6043: checking for $ac_hdr" >&5
+echo "configure:6022: 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
-#line 6048 "configure"
+#line 6027 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6032: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6076,7 +6055,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:6080: checking for db" >&5
+echo "configure:6059: checking for db" >&5
 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6123,17 +6102,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:6127: checking for $ac_hdr" >&5
+echo "configure:6106: 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
-#line 6132 "configure"
+#line 6111 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6137: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6116: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6164,7 +6143,7 @@ done
                have_wrappers=no
        else
                echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
-echo "configure:6168: checking for main in -lwrap" >&5
+echo "configure:6147: 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
@@ -6172,14 +6151,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lwrap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6176 "configure"
+#line 6155 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:6183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6162: \"$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
@@ -6219,23 +6198,113 @@ EOF
        fi
 fi
 
+if test $ol_enable_dmalloc != no ; then
+       for ac_hdr in dmalloc.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:6207: 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
+#line 6212 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:6217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+       echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
+echo "configure:6244: checking for dmalloc_shutdown in -ldmalloc" >&5
+ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-ldmalloc  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6252 "configure"
+#include "confdefs.h"
+/* 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 dmalloc_shutdown();
+
+int main() {
+dmalloc_shutdown()
+; return 0; }
+EOF
+if { (eval echo configure:6263: \"$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
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-ldmalloc $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+
 # ud needs termcap (should insert check here)
 ol_link_termcap=no
 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:6229: checking for $ac_hdr" >&5
+echo "configure:6298: 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
-#line 6234 "configure"
+#line 6303 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6308: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6264,7 +6333,7 @@ done
 
 if test $ol_link_termcap = no ; then
        echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
-echo "configure:6268: checking for tputs in -ltermcap" >&5
+echo "configure:6337: 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
@@ -6272,7 +6341,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6276 "configure"
+#line 6345 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6283,7 +6352,7 @@ int main() {
 tputs()
 ; return 0; }
 EOF
-if { (eval echo configure:6287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6356: \"$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
@@ -6316,7 +6385,7 @@ fi
 
 if test $ol_link_termcap = no ; then
        echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
-echo "configure:6320: checking for initscr in -lncurses" >&5
+echo "configure:6389: 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
@@ -6324,7 +6393,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lncurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6328 "configure"
+#line 6397 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6335,7 +6404,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:6339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6408: \"$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
@@ -6377,12 +6446,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:6381: checking for crypt" >&5
+echo "configure:6450: 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 <<EOF
-#line 6386 "configure"
+#line 6455 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char crypt(); below.  */
@@ -6405,7 +6474,7 @@ crypt();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_crypt=yes"
 else
@@ -6424,7 +6493,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:6428: checking for crypt in -lcrypt" >&5
+echo "configure:6497: 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
@@ -6432,7 +6501,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6436 "configure"
+#line 6505 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6443,7 +6512,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:6447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6516: \"$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
@@ -6487,12 +6556,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:6491: checking for setproctitle" >&5
+echo "configure:6560: 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 <<EOF
-#line 6496 "configure"
+#line 6565 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char setproctitle(); below.  */
@@ -6515,7 +6584,7 @@ setproctitle();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_setproctitle=yes"
 else
@@ -6534,7 +6603,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
-echo "configure:6538: checking for setproctitle in -lutil" >&5
+echo "configure:6607: 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
@@ -6542,7 +6611,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lutil  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6546 "configure"
+#line 6615 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6553,7 +6622,7 @@ int main() {
 setproctitle()
 ; return 0; }
 EOF
-if { (eval echo configure:6557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6626: \"$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
@@ -6588,12 +6657,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:6592: checking for ANSI C header files" >&5
+echo "configure:6661: 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 <<EOF
-#line 6597 "configure"
+#line 6666 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -6601,7 +6670,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6674: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6618,7 +6687,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
-#line 6622 "configure"
+#line 6691 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -6636,7 +6705,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
-#line 6640 "configure"
+#line 6709 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -6657,7 +6726,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 6661 "configure"
+#line 6730 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -6668,7 +6737,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:6672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -6701,12 +6770,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:6705: checking for $ac_hdr that defines DIR" >&5
+echo "configure:6774: 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 <<EOF
-#line 6710 "configure"
+#line 6779 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -6714,7 +6783,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:6718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -6739,7 +6808,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:6743: checking for opendir in -ldir" >&5
+echo "configure:6812: 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
@@ -6747,7 +6816,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6751 "configure"
+#line 6820 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6758,7 +6827,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:6762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6831: \"$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
@@ -6780,7 +6849,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:6784: checking for opendir in -lx" >&5
+echo "configure:6853: 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
@@ -6788,7 +6857,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6792 "configure"
+#line 6861 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6799,7 +6868,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:6803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6872: \"$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
@@ -6822,12 +6891,12 @@ fi
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:6826: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:6895: 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 <<EOF
-#line 6831 "configure"
+#line 6900 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -6843,7 +6912,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:6847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6916: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -6864,12 +6933,12 @@ EOF
 fi
 
 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
-echo "configure:6868: checking POSIX termios" >&5
+echo "configure:6937: 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 <<EOF
-#line 6873 "configure"
+#line 6942 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <unistd.h>
@@ -6879,7 +6948,7 @@ int main() {
    tcgetattr(0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:6883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   am_cv_sys_posix_termios=yes
 else
@@ -6895,7 +6964,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:6899: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
+echo "configure:6968: 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
@@ -6904,7 +6973,7 @@ else
   gwinsz_in_termios_h=no
   if test $am_cv_sys_posix_termios = yes; then
     cat > conftest.$ac_ext <<EOF
-#line 6908 "configure"
+#line 6977 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <termios.h>
@@ -6924,7 +6993,7 @@ rm -f conftest*
 
   if test $gwinsz_in_termios_h = no; then
     cat > conftest.$ac_ext <<EOF
-#line 6928 "configure"
+#line 6997 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <sys/ioctl.h>
@@ -6994,17 +7063,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:6998: checking for $ac_hdr" >&5
+echo "configure:7067: 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
-#line 7003 "configure"
+#line 7072 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7077: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7032,12 +7101,12 @@ done
 
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:7036: checking for uid_t in sys/types.h" >&5
+echo "configure:7105: 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
-#line 7041 "configure"
+#line 7110 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -7066,7 +7135,7 @@ EOF
 fi
 
 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:7070: checking type of array argument to getgroups" >&5
+echo "configure:7139: 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
@@ -7074,7 +7143,7 @@ else
   ac_cv_type_getgroups=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 7078 "configure"
+#line 7147 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Rendell for this test.  */
@@ -7099,7 +7168,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:7103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7172: \"$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
@@ -7113,7 +7182,7 @@ fi
 
 if test $ac_cv_type_getgroups = cross; then
         cat > conftest.$ac_ext <<EOF
-#line 7117 "configure"
+#line 7186 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 EOF
@@ -7136,12 +7205,12 @@ cat >> confdefs.h <<EOF
 EOF
 
  echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:7140: checking for mode_t" >&5
+echo "configure:7209: 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 <<EOF
-#line 7145 "configure"
+#line 7214 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -7169,12 +7238,12 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:7173: checking for off_t" >&5
+echo "configure:7242: 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 <<EOF
-#line 7178 "configure"
+#line 7247 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -7202,12 +7271,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:7206: checking for pid_t" >&5
+echo "configure:7275: 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 <<EOF
-#line 7211 "configure"
+#line 7280 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -7235,19 +7304,19 @@ EOF
 fi
 
 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
-echo "configure:7239: checking for ptrdiff_t" >&5
+echo "configure:7308: 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 <<EOF
-#line 7244 "configure"
+#line 7313 "configure"
 #include "confdefs.h"
 #include <stddef.h>
 int main() {
 ptrdiff_t p
 ; return 0; }
 EOF
-if { (eval echo configure:7251: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7320: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_type_ptrdiff_t=yes
 else
@@ -7268,12 +7337,12 @@ EOF
    fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:7272: checking return type of signal handlers" >&5
+echo "configure:7341: 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 <<EOF
-#line 7277 "configure"
+#line 7346 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -7290,7 +7359,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:7294: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -7309,12 +7378,12 @@ EOF
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:7313: checking for size_t" >&5
+echo "configure:7382: 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 <<EOF
-#line 7318 "configure"
+#line 7387 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -7342,12 +7411,12 @@ EOF
 fi
 
 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:7346: checking for st_blksize in struct stat" >&5
+echo "configure:7415: 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 <<EOF
-#line 7351 "configure"
+#line 7420 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -7355,7 +7424,7 @@ int main() {
 struct stat s; s.st_blksize;
 ; return 0; }
 EOF
-if { (eval echo configure:7359: \"$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_st_blksize=yes
 else
@@ -7376,12 +7445,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:7380: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:7449: 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 <<EOF
-#line 7385 "configure"
+#line 7454 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -7390,7 +7459,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:7394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -7411,12 +7480,12 @@ EOF
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:7415: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:7484: 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 <<EOF
-#line 7420 "configure"
+#line 7489 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -7424,7 +7493,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:7428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -7447,7 +7516,7 @@ fi
 
 
 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
-echo "configure:7451: checking if toupper() requires islower()" >&5
+echo "configure:7520: 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
@@ -7456,7 +7525,7 @@ else
   ol_cv_c_upper_lower=safe
 else
   cat > conftest.$ac_ext <<EOF
-#line 7460 "configure"
+#line 7529 "configure"
 #include "confdefs.h"
 
 #include <ctype.h>
@@ -7468,7 +7537,7 @@ main()
                exit(1);
 }
 EOF
-if { (eval echo configure:7472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7541: \"$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
@@ -7491,12 +7560,12 @@ EOF
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:7495: checking for working const" >&5
+echo "configure:7564: 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 <<EOF
-#line 7500 "configure"
+#line 7569 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -7545,7 +7614,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:7549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7618: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -7573,14 +7642,14 @@ EOF
 
 else
        echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:7577: checking whether byte ordering is bigendian" >&5
+echo "configure:7646: 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 <<EOF
-#line 7584 "configure"
+#line 7653 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -7591,11 +7660,11 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:7595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7664: \"$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 <<EOF
-#line 7599 "configure"
+#line 7668 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -7606,7 +7675,7 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:7610: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7679: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -7626,7 +7695,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 <<EOF
-#line 7630 "configure"
+#line 7699 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -7639,7 +7708,7 @@ main () {
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:7643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_bigendian=no
 else
@@ -7663,7 +7732,7 @@ EOF
 fi
 
        echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:7667: checking size of short" >&5
+echo "configure:7736: 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
@@ -7671,7 +7740,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 7675 "configure"
+#line 7744 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -7682,7 +7751,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:7686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7755: \"$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
@@ -7702,7 +7771,7 @@ EOF
 
  
        echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:7706: checking size of int" >&5
+echo "configure:7775: 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
@@ -7710,7 +7779,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 7714 "configure"
+#line 7783 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -7721,7 +7790,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:7725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7794: \"$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
@@ -7741,7 +7810,7 @@ EOF
 
  
        echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:7745: checking size of long" >&5
+echo "configure:7814: 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
@@ -7749,7 +7818,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 7753 "configure"
+#line 7822 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -7760,7 +7829,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:7764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7833: \"$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
@@ -7782,7 +7851,7 @@ EOF
 fi
 
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:7786: checking for 8-bit clean memcmp" >&5
+echo "configure:7855: 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
@@ -7790,7 +7859,7 @@ else
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 7794 "configure"
+#line 7863 "configure"
 #include "confdefs.h"
 
 main()
@@ -7800,7 +7869,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:7804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7873: \"$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
@@ -7818,12 +7887,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:7822: checking for strftime" >&5
+echo "configure:7891: 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 <<EOF
-#line 7827 "configure"
+#line 7896 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strftime(); below.  */
@@ -7846,7 +7915,7 @@ strftime();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_strftime=yes"
 else
@@ -7868,7 +7937,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:7872: checking for strftime in -lintl" >&5
+echo "configure:7941: 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
@@ -7876,7 +7945,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7880 "configure"
+#line 7949 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7887,7 +7956,7 @@ int main() {
 strftime()
 ; return 0; }
 EOF
-if { (eval echo configure:7891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7960: \"$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
@@ -7914,12 +7983,12 @@ fi
 fi
 
 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:7918: checking for vprintf" >&5
+echo "configure:7987: 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 <<EOF
-#line 7923 "configure"
+#line 7992 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vprintf(); below.  */
@@ -7942,7 +8011,7 @@ vprintf();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_vprintf=yes"
 else
@@ -7966,12 +8035,12 @@ fi
 
 if test "$ac_cv_func_vprintf" != yes; then
 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:7970: checking for _doprnt" >&5
+echo "configure:8039: 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 <<EOF
-#line 7975 "configure"
+#line 8044 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt(); below.  */
@@ -7994,7 +8063,7 @@ _doprnt();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func__doprnt=yes"
 else
@@ -8023,12 +8092,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:8027: checking for $ac_func" >&5
+echo "configure:8096: 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 <<EOF
-#line 8032 "configure"
+#line 8101 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8051,7 +8120,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8108,12 +8177,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8112: checking for $ac_func" >&5
+echo "configure:8181: 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 <<EOF
-#line 8117 "configure"
+#line 8186 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8136,7 +8205,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8164,12 +8233,12 @@ done
 for ac_func in getopt strdup tempnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8168: checking for $ac_func" >&5
+echo "configure:8237: 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 <<EOF
-#line 8173 "configure"
+#line 8242 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8192,7 +8261,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8222,13 +8291,13 @@ done
 # Check Configuration
 
 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
-echo "configure:8226: checking declaration of sys_errlist" >&5
+echo "configure:8295: 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 <<EOF
-#line 8232 "configure"
+#line 8301 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -8238,7 +8307,7 @@ int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:8242: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_dcl_sys_errlist=yes
 else
@@ -8259,20 +8328,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:8263: checking existence of sys_errlist" >&5
+echo "configure:8332: 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 <<EOF
-#line 8269 "configure"
+#line 8338 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:8276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ol_cv_have_sys_errlist=yes
 else
index 74a42b49924477b5f8c78f2891aa0019ea8679fb..84762beaedc11b95090c74224caafa09e1e72fbc 100644 (file)
@@ -50,6 +50,8 @@ OL_ARG_ENABLE(x_compile,[  --enable-x-compile enable cross compiling],
        no, [yes no])dnl
 
 dnl General "with" options
+OL_ARG_ENABLE(dmalloc,[  --enable-dmalloc      enable debug malloc support], no)dnl
+
 OL_ARG_WITH(kerberos,[  --with-kerberos        use Kerberos],
        auto, [auto k5 k4 afs yes no])
 OL_ARG_WITH(threads,[  --with-threads  use threads],
@@ -592,30 +594,28 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
                        if test $ac_cv_func_sched_yield = no -a \
                                $ac_cv_func_pthread_yield = no ; then
                                dnl Solaris has sched_yield() in -lposix4
-                               AC_CHECK_LIB(posix4, sched_yield,
-                                       [LTHREAD_LIBS="$LTHREAD_LIBS -lposix4"
-                                       AC_DEFINE(HAVE_SCHED_YIELD,1)
-                                       ac_cv_func_sched_yield=yes],
-                                       [ac_cv_func_sched_yield=no])
+                               dnl but we'll use thr_yield instead.
+                               AC_CHECK_FUNCS(thr_yield)
                        fi
                        if test $ac_cv_func_sched_yield = no -a \
-                               $ac_cv_func_pthread_yield = no ; then
+                               $ac_cv_func_pthread_yield = no -a \
+                               "$ac_cv_func_thr_yield" = no ; then
                                AC_MSG_WARN([could not locate sched_yield() or pthread_yield()])
                        fi
 
                        dnl Check functions for compatibility
                        AC_CHECK_FUNCS(pthread_kill pthread_detach)
 
-                       AC_CHECK_FUNCS( \
-                               pthread_attr_create pthread_attr_init \
-                               pthread_attr_destroy pthread_attr_delete \
-                               pthread_attr_setdetachstate pthread_attr_setdetach_np \
-                       )
+                       if test $ac_cv_func_pthread_detach = no ; then
+                               AC_MSG_ERROR([could not locate pthread_detach()])
+                       fi
 
                        dnl Check for setconcurreny functions
                        AC_CHECK_FUNCS( \
                                pthread_setconcurrency \
+                               pthread_getconcurrency \
                                thr_setconcurrency \
+                               thr_getconcurrency \
                        )
 
                        AC_MSG_CHECKING([if pthread_create() works])
@@ -1018,6 +1018,11 @@ if test $ol_enable_wrappers != no ; then
        fi
 fi
 
+if test $ol_enable_dmalloc != no ; then
+       AC_CHECK_HEADERS(dmalloc.h)
+       AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
+fi
+
 # ud needs termcap (should insert check here)
 ol_link_termcap=no
 AC_CHECK_HEADERS(termcap.h ncurses.h)
diff --git a/include/ldap_pvt_thread.h b/include/ldap_pvt_thread.h
new file mode 100644 (file)
index 0000000..dd73e7f
--- /dev/null
@@ -0,0 +1,263 @@
+/*
+ * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted only
+ * as authorized by the OpenLDAP Public License.  A copy of this
+ * license is available at http://www.OpenLDAP.org/license.html or
+ * in file LICENSE in the top-level directory of the distribution.
+ */
+/* ldap_pvt_thread.h - ldap threads header file NG */
+
+#ifndef _LDAP_PVT_THREAD_H
+#define _LDAP_PVT_THREAD_H
+
+#include "ldap_cdefs.h"
+
+#if defined( HAVE_PTHREADS )
+/**********************************
+ *                                *
+ * definitions for POSIX Threads  *
+ *                                *
+ **********************************/
+
+#include <pthread.h>
+#ifdef HAVE_SCHED_H
+#include <sched.h>
+#endif
+
+LDAP_BEGIN_DECL
+
+typedef pthread_t              ldap_pvt_thread_t;
+typedef pthread_mutex_t                ldap_pvt_thread_mutex_t;
+typedef pthread_cond_t         ldap_pvt_thread_cond_t;
+
+#if defined( _POSIX_REENTRANT_FUNCTIONS ) || \
+       defined( _POSIX_THREAD_SAFE_FUNCTIONS ) || \
+       defined( _POSIX_THREADSAFE_FUNCTIONS )
+#define HAVE_REENTRANT_FUNCTIONS 1
+#endif
+
+#if defined( HAVE_PTHREAD_GETCONCURRENCY ) || \
+       defined( HAVE_THR_GETCONCURRENCY )
+#define HAVE_GETCONCURRENCY 1
+#endif
+
+#if defined( HAVE_PTHREAD_SETCONCURRENCY ) || \
+       defined( HAVE_THR_SETCONCURRENCY )
+#define HAVE_SETCONCURRENCY 1
+#endif
+
+LDAP_END_DECL
+
+#elif defined ( HAVE_MACH_CTHREADS )
+/**********************************
+ *                                *
+ * definitions for Mach CThreads  *
+ *                                *
+ **********************************/
+
+#include <mach/cthreads.h>
+
+LDAP_BEGIN_DECL
+
+typedef cthread_t              ldap_pvt_thread_t;
+typedef struct mutex           ldap_pvt_thread_mutex_t;
+typedef struct condition       ldap_pvt_thread_cond_t;
+
+LDAP_END_DECL
+
+#elif defined( HAVE_THR )
+/********************************************
+ *                                          *
+ * thread definitions for Solaris LWP (THR) *
+ *                                          *
+ ********************************************/
+
+#include <thread.h>
+#include <synch.h>
+
+LDAP_BEGIN_DECL
+
+typedef thread_t               ldap_pvt_thread_t;
+typedef mutex_t                        ldap_pvt_thread_mutex_t;
+typedef cond_t                 ldap_pvt_thread_cond_t;
+
+#define HAVE_REENTRANT_FUNCTIONS 1
+
+#ifdef HAVE_THR_GETCONCURRENCY
+#define HAVE_GETCONCURRENCY 1
+#endif
+#ifdef HAVE_THR_SETCONCURRENCY
+#define HAVE_SETCONCURRENCY 1
+#endif
+
+LDAP_END_DECL
+
+#elif defined( HAVE_LWP )
+/*************************************
+ *                                   *
+ * thread definitions for SunOS LWP  *
+ *                                   *
+ *************************************/
+
+#include <lwp/lwp.h>
+#include <lwp/stackdep.h>
+
+LDAP_BEGIN_DECL
+
+typedef thread_t               ldap_pvt_thread_t;
+typedef mon_t                  ldap_pvt_thread_mutex_t;
+struct lwpcv {
+       int             lcv_created;
+       cv_t            lcv_cv;
+};
+typedef struct lwpcv           ldap_pvt_thread_cond_t;
+
+#define HAVE_REENTRANT_FUNCTIONS 1
+
+LDAP_END_DECL
+
+#elif HAVE_NT_THREADS
+
+#include <windows.h>
+#include <process.h>
+
+LDAP_BEGIN_DECL
+
+typedef HANDLE                 ldap_pvt_thread_t;
+typedef HANDLE                 ldap_pvt_thread_mutex_t;
+typedef HANDLE                 ldap_pvt_thread_cond_t;
+
+LDAP_END_DECL
+
+#else
+
+/***********************************
+ *                                 *
+ * thread definitions for no       *
+ * underlying library support      *
+ *                                 *
+ ***********************************/
+
+LDAP_BEGIN_DECL
+
+#ifndef NO_THREADS
+#define NO_THREADS 1
+#endif
+
+typedef int                    ldap_pvt_thread_t;
+typedef int                    ldap_pvt_thread_mutex_t;
+typedef int                    ldap_pvt_thread_cond_t;
+
+LDAP_END_DECL
+
+#endif /* no threads support */
+
+#ifndef NO_THREADS
+#      define HAVE_THREADS 1
+
+#endif
+
+LDAP_BEGIN_DECL
+
+LDAP_F int
+ldap_pvt_thread_initialize LDAP_P(( void ));
+
+LDAP_F unsigned int
+ldap_pvt_thread_sleep LDAP_P(( unsigned int s ));
+
+#ifdef HAVE_GETCONCURRENCY
+LDAP_F int
+ldap_pvt_thread_getconcurrency LDAP_P(( void ));
+#endif
+#ifdef HAVE_SETCONCURRENCY
+#      ifndef LDAP_THREAD_CONCURRENCY
+       /* three concurrent threads should be enough */
+#      define LDAP_THREAD_CONCURRENCY  3
+#      endif
+LDAP_F int
+ldap_pvt_thread_setconcurrency LDAP_P(( int ));
+#endif
+
+LDAP_F int 
+ldap_pvt_thread_create LDAP_P((
+       ldap_pvt_thread_t * thread, 
+       int     detach,
+       void *(*start_routine)( void * ), 
+       void *arg));
+
+LDAP_F void 
+ldap_pvt_thread_exit LDAP_P(( void *retval ));
+
+LDAP_F int 
+ldap_pvt_thread_join LDAP_P(( ldap_pvt_thread_t thread, void **status ));
+
+LDAP_F int 
+ldap_pvt_thread_kill LDAP_P(( ldap_pvt_thread_t thread, int signo ));
+
+LDAP_F int 
+ldap_pvt_thread_yield LDAP_P(( void ));
+
+LDAP_F int 
+ldap_pvt_thread_cond_init LDAP_P(( ldap_pvt_thread_cond_t *cond ));
+
+LDAP_F int 
+ldap_pvt_thread_cond_signal LDAP_P(( ldap_pvt_thread_cond_t *cond ));
+
+LDAP_F int 
+ldap_pvt_thread_cond_broadcast LDAP_P(( ldap_pvt_thread_cond_t *cond ));
+
+LDAP_F int 
+ldap_pvt_thread_cond_wait LDAP_P((
+       ldap_pvt_thread_cond_t *cond, 
+       ldap_pvt_thread_mutex_t *mutex ));
+
+LDAP_F int 
+ldap_pvt_thread_mutex_init LDAP_P(( ldap_pvt_thread_mutex_t *mutex ));
+
+LDAP_F int 
+ldap_pvt_thread_mutex_destroy LDAP_P(( ldap_pvt_thread_mutex_t *mutex ));
+
+LDAP_F int 
+ldap_pvt_thread_mutex_lock LDAP_P(( ldap_pvt_thread_mutex_t *mutex ));
+
+LDAP_F int 
+ldap_pvt_thread_mutex_trylock LDAP_P(( ldap_pvt_thread_mutex_t *mutex ));
+
+LDAP_F int 
+ldap_pvt_thread_mutex_unlock LDAP_P(( ldap_pvt_thread_mutex_t *mutex ));
+
+typedef struct ldap_pvt_thread_rdwr_var {
+       int lt_readers_reading;
+       int lt_writer_writing;
+       ldap_pvt_thread_mutex_t lt_mutex;
+       ldap_pvt_thread_cond_t lt_lock_free;
+} ldap_pvt_thread_rdwr_t;
+
+#define LDAP_PVT_THREAD_CREATE_DETACHED 1
+#define LDAP_PVT_THREAD_CREATE_JOINABLE 0
+
+LDAP_F int 
+ldap_pvt_thread_rdwr_init LDAP_P((ldap_pvt_thread_rdwr_t *rdwrp));
+LDAP_F int 
+ldap_pvt_thread_rdwr_rlock LDAP_P((ldap_pvt_thread_rdwr_t *rdwrp));
+LDAP_F int 
+ldap_pvt_thread_rdwr_runlock LDAP_P((ldap_pvt_thread_rdwr_t *rdwrp));
+LDAP_F int 
+ldap_pvt_thread_rdwr_wlock LDAP_P((ldap_pvt_thread_rdwr_t *rdwrp));
+LDAP_F int 
+ldap_pvt_thread_rdwr_wunlock LDAP_P((ldap_pvt_thread_rdwr_t *rdwrp));
+
+#ifdef LDAP_DEBUG
+LDAP_F int 
+ldap_pvt_thread_rdwr_rchk LDAP_P((ldap_pvt_thread_rdwr_t *rdwrp));
+LDAP_F int 
+ldap_pvt_thread_rdwr_wchk LDAP_P((ldap_pvt_thread_rdwr_t *rdwrp));
+LDAP_F int 
+ldap_pvt_thread_rdwr_rwchk LDAP_P((ldap_pvt_thread_rdwr_t *rdwrp));
+#endif /* LDAP_DEBUG */
+
+LDAP_END_DECL
+
+#endif /* _LDAP_THREAD_H */
diff --git a/include/lthread.h b/include/lthread.h
deleted file mode 100644 (file)
index 974f717..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted only
- * as authorized by the OpenLDAP Public License.  A copy of this
- * license is available at http://www.OpenLDAP.org/license.html or
- * in file LICENSE in the top-level directory of the distribution.
- */
-/* lthread.h - ldap threads header file */
-
-#ifndef _LTHREAD_H
-#define _LTHREAD_H
-
-#include "portable.h"
-
-#if defined( HAVE_PTHREADS )
-/**********************************
- *                                *
- * definitions for POSIX Threads  *
- *                                *
- **********************************/
-
-#include <pthread.h>
-#ifdef HAVE_SCHED_H
-#include <sched.h>
-#endif
-
-LDAP_BEGIN_DECL
-
-#if !defined( HAVE_PTHREAD_ATTR_INIT ) && \
-       defined( HAVE_PTHREAD_ATTR_CREATE )
-#define pthread_attr_init( a )         pthread_attr_create( a )
-#endif
-
-#if !defined( HAVE_PTHREAD_ATTR_DESTROY ) && \
-       defined( HAVE_PTHREAD_ATTR_DELETE )
-#define pthread_attr_destroy( a )      pthread_attr_delete( a )
-#endif
-
-#if !defined( HAVE_PTHREAD_ATTR_SETDETACHSTATE ) && \
-       defined( HAVE_PTHREAD_ATTR_SETDETACH_NP )
-#define pthread_attr_setdetachstate( a, b ) \
-                                       pthread_attr_setdetach_np( a, b )
-#endif
-
-#ifndef HAVE_PTHREAD_KILL
-/* missing pthread_kill(), define prototype */
-LDAP_F void pthread_kill LDAP_P(( pthread_t tid, int sig ));
-#endif
-
-#ifndef HAVE_PTHREADS_D4
-#define pthread_mutexattr_default      NULL
-#define pthread_condattr_default       NULL
-
-#ifdef HAVE_SCHED_YIELD
-#define pthread_yield sched_yield
-#endif
-#endif
-
-LDAP_END_DECL
-
-#elif defined ( HAVE_MACH_CTHREADS )
-/**********************************
- *                                *
- * definitions for Mach CThreads  *
- *                                *
- **********************************/
-
-#include <mach/cthreads.h>
-
-LDAP_BEGIN_DECL
-
-typedef cthread_fn_t   VFP;
-typedef int            pthread_attr_t;
-typedef cthread_t      pthread_t;
-
-/* default attr states */
-#define pthread_mutexattr_default      NULL
-#define pthread_condattr_default       NULL
-
-/* thread state - joinable or not */
-#define PTHREAD_CREATE_JOINABLE        0
-#define PTHREAD_CREATE_DETACHED        1
-/* thread scope - who is in scheduling pool */
-#define PTHREAD_SCOPE_PROCESS  0
-#define PTHREAD_SCOPE_SYSTEM   1
-
-/* mutex attributes and mutex type */
-typedef int    pthread_mutexattr_t;
-typedef struct mutex pthread_mutex_t;
-
-/* mutex and condition variable scope - process or system */
-#define PTHREAD_SHARE_PRIVATE  0
-#define PTHREAD_SHARE_PROCESS  1
-
-/* condition variable attributes and condition variable type */
-typedef int    pthread_condattr_t;
-typedef struct condition pthread_cond_t;
-
-LDAP_END_DECL
-
-#elif defined( HAVE_THR )
-/**************************************
- *                                    *
- * thread definitions for Solaris LWP *
- *                                    *
- **************************************/
-
-#include <thread.h>
-#include <synch.h>
-
-LDAP_BEGIN_DECL
-
-typedef void   *(*VFP)();
-
-/* default attr states */
-#define pthread_mutexattr_default      NULL
-#define pthread_condattr_default       NULL
-
-/* thread state - joinable or not */
-#define PTHREAD_CREATE_JOINABLE 0
-#define PTHREAD_CREATE_DETACHED THR_DETACHED
-/* thread scope - who is in scheduling pool */
-#define PTHREAD_SCOPE_PROCESS   0
-#define PTHREAD_SCOPE_SYSTEM    THR_BOUND
-/* mutex and condition variable scope - process or system */
-#define PTHREAD_SHARE_PRIVATE   USYNC_THREAD
-#define PTHREAD_SHARE_PROCESS   USYNC_PROCESS
-
-/* thread attributes and thread type */
-typedef int            pthread_attr_t;
-typedef thread_t       pthread_t;
-
-/* mutex attributes and mutex type */
-typedef int    pthread_mutexattr_t;
-typedef mutex_t        pthread_mutex_t;
-
-/* condition variable attributes and condition variable type */
-typedef int     pthread_condattr_t;
-typedef cond_t pthread_cond_t;
-
-LDAP_END_DECL
-
-#elif defined( HAVE_LWP )
-/*************************************
- *                                   *
- * thread definitions for SunOS LWP  *
- *                                   *
- *************************************/
-
-#include <lwp/lwp.h>
-#include <lwp/stackdep.h>
-
-LDAP_BEGIN_DECL
-
-stkalign_t *get_stack( int *stacknop );
-void free_stack( int *stackno );
-
-typedef void   *(*VFP)();
-
-/* thread attributes and thread type */
-typedef int            pthread_attr_t;
-typedef thread_t       pthread_t;
-
-/* default attr states */
-#define pthread_mutexattr_default      NULL
-#define pthread_condattr_default       NULL
-
-/* thread state - joinable or not */
-#define PTHREAD_CREATE_JOINABLE        0
-#define PTHREAD_CREATE_DETACHED        1
-/* thread scope - who is in scheduling pool */
-#define PTHREAD_SCOPE_PROCESS  0
-#define PTHREAD_SCOPE_SYSTEM   1
-
-/* mutex attributes and mutex type */
-typedef int    pthread_mutexattr_t;
-typedef mon_t  pthread_mutex_t;
-
-/* mutex and condition variable scope - process or system */
-#define PTHREAD_SHARE_PRIVATE  0
-#define PTHREAD_SHARE_PROCESS  1
-
-/* condition variable attributes and condition variable type */
-typedef int    pthread_condattr_t;
-typedef struct lwpcv {
-       int             lcv_created;
-       cv_t            lcv_cv;
-} pthread_cond_t;
-
-LDAP_END_DECL
-
-#else
-
-/***********************************
- *                                 *
- * thread definitions for no       *
- * underlying library support      *
- *                                 *
- ***********************************/
-
-LDAP_BEGIN_DECL
-
-#ifndef NO_THREADS
-#define NO_THREADS 1
-#endif
-
-typedef void   *(*VFP)();
-
-/* thread attributes and thread type */
-typedef int    pthread_attr_t;
-typedef int    pthread_t;
-
-/* default attr states */
-#define pthread_mutexattr_default      NULL
-#define pthread_condattr_default       NULL
-
-/* thread state - joinable or not */
-#define PTHREAD_CREATE_JOINABLE 0
-#define PTHREAD_CREATE_DETACHED 0
-/* thread scope - who is in scheduling pool */
-#define PTHREAD_SCOPE_PROCESS   0
-#define PTHREAD_SCOPE_SYSTEM    0
-
-/* mutex attributes and mutex type */
-typedef int    pthread_mutexattr_t;
-typedef int    pthread_mutex_t;
-
-/* mutex and condition variable scope - process or system */
-#define PTHREAD_SHARE_PRIVATE   0
-#define PTHREAD_SHARE_PROCESS   0
-
-/* condition variable attributes and condition variable type */
-typedef int     pthread_condattr_t;
-typedef int    pthread_cond_t;
-
-LDAP_END_DECL
-
-#endif /* no threads support */
-#endif /* _LTHREAD_H */
diff --git a/include/lthread_rdwr.h b/include/lthread_rdwr.h
deleted file mode 100644 (file)
index c4beb36..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted only
- * as authorized by the OpenLDAP Public License.  A copy of this
- * license is available at http://www.OpenLDAP.org/license.html or
- * in file LICENSE in the top-level directory of the distribution.
- */
-
-#ifndef _LTHREAD_RDWR_H
-#define _LTHREAD_RDWR_H 1
-
-/********************************************************
- * An example source module to accompany...
- *
- * "Using POSIX Threads: Programming with Pthreads"
- *     by Brad nichols, Dick Buttlar, Jackie Farrell
- *     O'Reilly & Associates, Inc.
- *
- ********************************************************
- * 
- * Include file for reader/writer locks
- * 
- */
-
-#include <ldap_cdefs.h>
-
-LDAP_BEGIN_DECL
-
-typedef struct rdwr_var {
-       int readers_reading;
-       int writer_writing;
-       pthread_mutex_t mutex;
-       pthread_cond_t lock_free;
-} pthread_rdwr_t;
-
-typedef void * pthread_rdwrattr_t;
-
-#define pthread_rdwrattr_default NULL;
-
-LDAP_F int pthread_rdwr_init_np LDAP_P((pthread_rdwr_t *rdwrp, pthread_rdwrattr_t *attrp));
-LDAP_F int pthread_rdwr_rlock_np LDAP_P((pthread_rdwr_t *rdwrp));
-LDAP_F int pthread_rdwr_runlock_np LDAP_P((pthread_rdwr_t *rdwrp));
-LDAP_F int pthread_rdwr_wlock_np LDAP_P((pthread_rdwr_t *rdwrp));
-LDAP_F int pthread_rdwr_wunlock_np LDAP_P((pthread_rdwr_t *rdwrp));
-
-#ifdef LDAP_DEBUG
-LDAP_F int pthread_rdwr_rchk_np LDAP_P((pthread_rdwr_t *rdwrp));
-LDAP_F int pthread_rdwr_wchk_np LDAP_P((pthread_rdwr_t *rdwrp));
-LDAP_F int pthread_rdwr_rwchk_np LDAP_P((pthread_rdwr_t *rdwrp));
-#endif /* LDAP_DEBUG */
-
-LDAP_END_DECL
-
-#endif /* _LTHREAD_RDWR_H */
index 612775772a17304b6ce9d89197a359c62a7182e5..d7f1dd2b8a92365418293c7b58a802d697fc610e 100644 (file)
 /* Define if you have the mkstemp function.  */
 #undef HAVE_MKSTEMP
 
-/* Define if you have the pthread_attr_create function.  */
-#undef HAVE_PTHREAD_ATTR_CREATE
-
-/* Define if you have the pthread_attr_delete function.  */
-#undef HAVE_PTHREAD_ATTR_DELETE
-
-/* Define if you have the pthread_attr_destroy function.  */
-#undef HAVE_PTHREAD_ATTR_DESTROY
-
-/* Define if you have the pthread_attr_init function.  */
-#undef HAVE_PTHREAD_ATTR_INIT
-
-/* Define if you have the pthread_attr_setdetach_np function.  */
-#undef HAVE_PTHREAD_ATTR_SETDETACH_NP
-
-/* Define if you have the pthread_attr_setdetachstate function.  */
-#undef HAVE_PTHREAD_ATTR_SETDETACHSTATE
-
 /* Define if you have the pthread_detach function.  */
 #undef HAVE_PTHREAD_DETACH
 
+/* Define if you have the pthread_getconcurrency function.  */
+#undef HAVE_PTHREAD_GETCONCURRENCY
+
 /* Define if you have the pthread_kill function.  */
 #undef HAVE_PTHREAD_KILL
 
 /* Define if you have the thr_setconcurrency function.  */
 #undef HAVE_THR_SETCONCURRENCY
 
+/* Define if you have the thr_yield function.  */
+#undef HAVE_THR_YIELD
+
 /* Define if you have the vsnprintf function.  */
 #undef HAVE_VSNPRINTF
 
 /* Define if you have the <dirent.h> header file.  */
 #undef HAVE_DIRENT_H
 
+/* Define if you have the <dmalloc.h> header file.  */
+#undef HAVE_DMALLOC_H
+
 /* Define if you have the <errno.h> header file.  */
 #undef HAVE_ERRNO_H
 
 /* Define if you have the bind library (-lbind).  */
 #undef HAVE_LIBBIND
 
+/* Define if you have the dmalloc library (-ldmalloc).  */
+#undef HAVE_LIBDMALLOC
+
 /* Define if you have the gen library (-lgen).  */
 #undef HAVE_LIBGEN
 
index d83bde5f6de1a5c369431a05dab2119c9ff245a4..cd0d8b74b6fee303999fc44ae2772b854c3cfbfc 100644 (file)
@@ -19,7 +19,7 @@
 #include <ac/errno.h>
 
 #include "ldbm.h"
-#include "lthread.h"
+#include "ldap_pvt_thread.h"
 
 #if defined( LDBM_USE_DBHASH ) || defined( LDBM_USE_DBBTREE )
 
@@ -87,9 +87,9 @@ void ldbm_initialize( void )
 #else
 
 /* 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))
+static ldap_pvt_thread_mutex_t ldbm_big_mutex;
+#define LDBM_LOCK      (ldap_pvt_thread_mutex_lock(&ldbm_big_mutex))
+#define LDBM_UNLOCK    (ldap_pvt_thread_mutex_unlock(&ldbm_big_mutex))
 
 void ldbm_initialize( void )
 {
@@ -97,7 +97,7 @@ void ldbm_initialize( void )
 
        if(initialized++) return;
 
-       pthread_mutex_init( &ldbm_big_mutex,  pthread_mutexattr_default );
+       ldap_pvt_thread_mutex_init( &ldbm_big_mutex );
 }
 
 #endif
@@ -373,9 +373,9 @@ ldbm_errno( LDBM ldbm )
 #include <sys/stat.h>
 
 /* 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))
+static ldap_pvt_thread_mutex_t ldbm_big_mutex;
+#define LDBM_LOCK      (ldap_pvt_thread_mutex_lock(&ldbm_big_mutex))
+#define LDBM_UNLOCK    (ldap_pvt_thread_mutex_unlock(&ldbm_big_mutex))
 
 void ldbm_initialize( void )
 {
@@ -383,7 +383,7 @@ void ldbm_initialize( void )
 
        if(initialized++) return;
 
-       pthread_mutex_init( &ldbm_big_mutex,  pthread_mutexattr_default );
+       ldap_pvt_thread_mutex_init( &ldbm_big_mutex );
 }
 
 /*****************************************************************
@@ -521,9 +521,9 @@ ldbm_errno( LDBM ldbm )
 #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))
+static ldap_pvt_thread_mutex_t ldbm_big_mutex;
+#define LDBM_LOCK      (ldap_pvt_thread_mutex_lock(&ldbm_big_mutex))
+#define LDBM_UNLOCK    (ldap_pvt_thread_mutex_unlock(&ldbm_big_mutex))
 
 void ldbm_initialize( void )
 {
@@ -531,7 +531,7 @@ void ldbm_initialize( void )
 
        if(initialized++) return;
 
-       pthread_mutex_init( &ldbm_big_mutex,  pthread_mutexattr_default );
+       ldap_pvt_thread_mutex_init( &ldbm_big_mutex );
 }
 
 /*****************************************************************
index 63da618a704a6b59a32ee031efe54aea7e79c79f..fbd958d3f4ad528705b3a00e01d04c652fb50f8e 100644 (file)
@@ -4,8 +4,12 @@
 
 LIBRARY        = liblthread.a
 XSRCS  = version.c
-SRCS   = rdwr.c thread.c stack.c
-OBJS   = rdwr.o thread.o stack.o
+
+SRCS   = rdwr.c thr_sleep.c thr_stub.c \
+       thr_cthreads.c thr_lwp.c thr_nt.c thr_posix.c thr_thr.c
+
+OBJS   = rdwr.o thr_sleep.o thr_stub.o \
+       thr_cthreads.o thr_lwp.o thr_nt.o thr_posix.o thr_thr.o
 
 LDAP_INCDIR= ../../include       
 LDAP_LIBDIR= ../../libraries
index f1053440c263890cc5f989ebb87e11ed0eae6217..56de51cf944ca352e415d9ff0c5218b53bee5cf2 100644 (file)
  * Library of functions implementing reader/writer locks
  */
 
-#include <portable.h>
+#include "portable.h"
 
 #include <stdlib.h>
-#include <lthread.h>
-#include <lthread_rdwr.h>
 
-int pthread_rdwr_init_np(pthread_rdwr_t *rdwrp, pthread_rdwrattr_t *attrp)
+#include "ldap_pvt_thread.h"
+
+int 
+ldap_pvt_thread_rdwr_init(ldap_pvt_thread_rdwr_t *rdwrp )
+{
+       rdwrp->lt_readers_reading = 0;
+       rdwrp->lt_writer_writing = 0;
+       ldap_pvt_thread_mutex_init(&(rdwrp->lt_mutex) );
+       ldap_pvt_thread_cond_init(&(rdwrp->lt_lock_free) );
+       return 0;
+}
+
+int 
+ldap_pvt_thread_rdwr_destroy(ldap_pvt_thread_rdwr_t *rdwrp )
 {
-       rdwrp->readers_reading = 0;
-       rdwrp->writer_writing = 0;
-       pthread_mutex_init(&(rdwrp->mutex), pthread_mutexattr_default);
-       pthread_cond_init(&(rdwrp->lock_free), pthread_condattr_default);
+       ldap_pvt_thread_mutex_destroy(&(rdwrp->lt_mutex) );
+       ldap_pvt_thread_cond_destroy(&(rdwrp->lt_lock_free) );
        return 0;
 }
 
-int pthread_rdwr_rlock_np(pthread_rdwr_t *rdwrp){
-       pthread_mutex_lock(&(rdwrp->mutex));
-       while(rdwrp->writer_writing) {
-               pthread_cond_wait(&(rdwrp->lock_free), &(rdwrp->mutex));
+int ldap_pvt_thread_rdwr_rlock(ldap_pvt_thread_rdwr_t *rdwrp){
+       ldap_pvt_thread_mutex_lock(&(rdwrp->lt_mutex));
+       while(rdwrp->lt_writer_writing) {
+               ldap_pvt_thread_cond_wait(&(rdwrp->lt_lock_free), 
+                                         &(rdwrp->lt_mutex));
        }
-       rdwrp->readers_reading++;
-       pthread_mutex_unlock(&(rdwrp->mutex));
+       rdwrp->lt_readers_reading++;
+       ldap_pvt_thread_mutex_unlock(&(rdwrp->lt_mutex));
        return 0;
 }
 
-int pthread_rdwr_runlock_np(pthread_rdwr_t *rdwrp)
+int ldap_pvt_thread_rdwr_runlock(ldap_pvt_thread_rdwr_t *rdwrp)
 {
-       pthread_mutex_lock(&(rdwrp->mutex));
-       if (rdwrp->readers_reading == 0) {
-               pthread_mutex_unlock(&(rdwrp->mutex));
+       ldap_pvt_thread_mutex_lock(&(rdwrp->lt_mutex));
+       if (rdwrp->lt_readers_reading == 0) {
+               ldap_pvt_thread_mutex_unlock(&(rdwrp->lt_mutex));
                return -1;
        }
        else {
-               rdwrp->readers_reading--;
-               if (rdwrp->readers_reading == 0) {
-                       pthread_cond_signal(&(rdwrp->lock_free));
+               rdwrp->lt_readers_reading--;
+               if (rdwrp->lt_readers_reading == 0) {
+                       ldap_pvt_thread_cond_signal(&(rdwrp->lt_lock_free));
                }
-               pthread_mutex_unlock(&(rdwrp->mutex));
+               ldap_pvt_thread_mutex_unlock(&(rdwrp->lt_mutex));
                return 0;
        }
 }
 
-int pthread_rdwr_wlock_np(pthread_rdwr_t *rdwrp)
+int ldap_pvt_thread_rdwr_wlock(ldap_pvt_thread_rdwr_t *rdwrp)
 {
-       pthread_mutex_lock(&(rdwrp->mutex));
-       while(rdwrp->writer_writing || rdwrp->readers_reading) {
-               pthread_cond_wait(&(rdwrp->lock_free), &(rdwrp->mutex));
+       ldap_pvt_thread_mutex_lock(&(rdwrp->lt_mutex));
+       while(rdwrp->lt_writer_writing || rdwrp->lt_readers_reading) {
+               ldap_pvt_thread_cond_wait(&(rdwrp->lt_lock_free), 
+                                         &(rdwrp->lt_mutex));
        }
-       rdwrp->writer_writing++;
-       pthread_mutex_unlock(&(rdwrp->mutex));
+       rdwrp->lt_writer_writing++;
+       ldap_pvt_thread_mutex_unlock(&(rdwrp->lt_mutex));
        return 0;
 }
 
-int pthread_rdwr_wunlock_np(pthread_rdwr_t *rdwrp)
+int ldap_pvt_thread_rdwr_wunlock(ldap_pvt_thread_rdwr_t *rdwrp)
 {
-       pthread_mutex_lock(&(rdwrp->mutex));
-       if (rdwrp->writer_writing == 0) {
-               pthread_mutex_unlock(&(rdwrp->mutex));
+       ldap_pvt_thread_mutex_lock(&(rdwrp->lt_mutex));
+       if (rdwrp->lt_writer_writing == 0) {
+               ldap_pvt_thread_mutex_unlock(&(rdwrp->lt_mutex));
                return -1;
        }
        else {
-               rdwrp->writer_writing = 0;
-               pthread_cond_broadcast(&(rdwrp->lock_free));
-               pthread_mutex_unlock(&(rdwrp->mutex));
+               rdwrp->lt_writer_writing = 0;
+               ldap_pvt_thread_cond_broadcast(&(rdwrp->lt_lock_free));
+               ldap_pvt_thread_mutex_unlock(&(rdwrp->lt_mutex));
                return 0;
        }
 }
@@ -89,7 +100,7 @@ int pthread_rdwr_wunlock_np(pthread_rdwr_t *rdwrp)
 #ifdef LDAP_DEBUG
 
 /* just for testing, 
- * return 0 if false, suitable for assert(pthread_rdwr_Xchk(rdwr))
+ * return 0 if false, suitable for assert(ldap_pvt_thread_rdwr_Xchk(rdwr))
  * 
  * Currently they don't check if the calling thread is the one 
  * that has the lock, just that there is a reader or writer.
@@ -98,18 +109,19 @@ int pthread_rdwr_wunlock_np(pthread_rdwr_t *rdwrp)
  * a lock are caught.
  */
 
-int pthread_rdwr_rchk_np(pthread_rdwr_t *rdwrp)
+int ldap_pvt_thread_rdwr_rchk(ldap_pvt_thread_rdwr_t *rdwrp)
 {
-       return(rdwrp->readers_reading!=0);
+       return(rdwrp->lt_readers_reading!=0);
 }
 
-int pthread_rdwr_wchk_np(pthread_rdwr_t *rdwrp)
+int ldap_pvt_thread_rdwr_wchk(ldap_pvt_thread_rdwr_t *rdwrp)
 {
-       return(rdwrp->writer_writing!=0);
+       return(rdwrp->lt_writer_writing!=0);
 }
-int pthread_rdwr_rwchk_np(pthread_rdwr_t *rdwrp)
+int ldap_pvt_thread_rdwr_rwchk(ldap_pvt_thread_rdwr_t *rdwrp)
 {
-       return(pthread_rdwr_rchk_np(rdwrp) || pthread_rdwr_wchk_np(rdwrp));
+       return(ldap_pvt_thread_rdwr_rchk(rdwrp) || 
+              ldap_pvt_thread_rdwr_wchk(rdwrp));
 }
 
 #endif /* LDAP_DEBUG */
diff --git a/libraries/liblthread/stack.c b/libraries/liblthread/stack.c
deleted file mode 100644 (file)
index c90eead..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/* stack.c - stack handling routines */
-
-#include "portable.h"
-
-#if defined( HAVE_LWP )
-
-#include <stdio.h>
-
-#include <ac/time.h>
-#include <ac/socket.h>
-
-#include "lber.h"
-#include "ldap.h"
-
-#include <lwp/lwp.h>
-#include <lwp/stackdep.h>
-
-#define MAX_STACK      51200
-#define MAX_THREADS    20
-
-struct stackinfo {
-       int             stk_inuse;
-       stkalign_t      *stk_stack;
-};
-
-static struct stackinfo        *stacks;
-
-stkalign_t *
-get_stack( int *stacknop )
-{
-       int     i;
-
-       if ( stacks == NULL ) {
-               stacks = (struct stackinfo *) ch_calloc( 1, MAX_THREADS *
-                   sizeof(struct stackinfo) );
-       }
-
-       for ( i = 0; i < MAX_THREADS; i++ ) {
-               if ( stacks[i].stk_inuse == 0 ) {
-                       break;
-               }
-       }
-
-       if ( i == MAX_THREADS ) {
-               Debug( LDAP_DEBUG_ANY,
-                   "no more stacks (max %d) - increase MAX_THREADS for more",
-                   MAX_THREADS, 0, 0 );
-               return( NULL );
-       }
-
-       if ( stacks[i].stk_stack == NULL ) {
-               stacks[i].stk_stack = (stkalign_t *) malloc(
-                   (MAX_STACK / sizeof(stkalign_t) + 1 )
-                   * sizeof(stkalign_t) );
-       }
-
-       *stacknop = i;
-       stacks[i].stk_inuse = 1;
-       return( stacks[i].stk_stack + MAX_STACK / sizeof(stkalign_t) );
-}
-
-void
-free_stack(
-    int        stackno
-)
-{
-       if ( stackno < 0 || stackno > MAX_THREADS ) {
-               Debug( LDAP_DEBUG_ANY, "free_stack of bogus stack %d",
-                   stackno, 0, 0 );
-       }
-
-       stacks[stackno].stk_inuse = 0;
-}
-
-#endif
diff --git a/libraries/liblthread/thr_cthreads.c b/libraries/liblthread/thr_cthreads.c
new file mode 100644 (file)
index 0000000..6eddb69
--- /dev/null
@@ -0,0 +1,142 @@
+/*
+ * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted only
+ * as authorized by the OpenLDAP Public License.  A copy of this
+ * license is available at http://www.OpenLDAP.org/license.html or
+ * in file LICENSE in the top-level directory of the distribution.
+ */
+
+/* thr_cthreads.c - wrapper for mach cthreads */
+
+#include "portable.h"
+#include "ldap_pvt_thread.h"
+
+#if defined( HAVE_MACH_CTHREADS )
+
+/***********************************************************************
+ *                                                                     *
+ * under NEXTSTEP or OPENSTEP use CThreads                             *
+ * lukeh@xedoc.com.au                                                  *
+ *                                                                     *
+ ***********************************************************************/
+
+int
+ldap_pvt_thread_initialize( void )
+{
+       return 0;
+}
+
+int 
+ldap_pvt_thread_create( ldap_pvt_thread_t * thread, 
+       int detach,
+       void *(*start_routine)( void *), void *arg)
+{
+       *thread = cthread_fork( (cthread_fn_t) start_routine, arg);
+       return ( *thread == NULL ? -1 : 0 );    
+}
+
+void 
+ldap_pvt_thread_exit( void *retval )
+{
+       cthread_exit( (any_t) retval );
+}
+
+int 
+ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **thread_return )
+{
+       void *status;
+       status = (void *) cthread_join ( tid );
+       if (thread_return != NULL)
+               {
+               *thread_return = status;
+               }
+       return 0;
+}
+
+int 
+ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
+{
+       return 0;
+}
+
+int 
+ldap_pvt_thread_yield( void )
+{
+       cthread_yield();
+       return 0;
+}
+
+int 
+ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond )
+{
+       condition_init( cond );
+       return( 0 );
+}
+
+int 
+ldap_pvt_thread_cond_destroy( ldap_pvt_thread_cond_t *cond )
+{
+       condition_clear( cond );
+       return( 0 );
+}
+
+int 
+ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond )
+{
+       condition_signal( cond );
+       return( 0 );
+}
+
+int
+ldap_pvt_thread_cond_broadcast( ldap_pvt_thread_cond_t *cond )
+{
+       condition_broadcast( cond );
+       return( 0 );
+}
+
+int 
+ldap_pvt_thread_cond_wait( ldap_pvt_thread_cond_t *cond, 
+                         ldap_pvt_thread_mutex_t *mutex )
+{
+       condition_wait( cond, mutex );
+       return( 0 );    
+}
+
+int 
+ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex )
+{
+       mutex_init( mutex );
+       mutex->name = NULL;
+       return ( 0 );
+}
+
+int 
+ldap_pvt_thread_mutex_destroy( ldap_pvt_thread_mutex_t *mutex )
+{
+       mutex_clear( mutex );
+       return ( 0 );   
+}
+       
+int 
+ldap_pvt_thread_mutex_lock( ldap_pvt_thread_mutex_t *mutex )
+{
+       mutex_lock( mutex );
+       return ( 0 );
+}
+
+int 
+ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_t *mutex )
+{
+       mutex_unlock( mutex );
+       return ( 0 );
+}
+
+int
+ldap_pvt_thread_mutex_trylock( ldap_pvt_thread_mutex_t *mutex )
+{
+       return mutex_try_lock( mutex );
+}
+
+#endif /* HAVE_MACH_CTHREADS */
diff --git a/libraries/liblthread/thr_lwp.c b/libraries/liblthread/thr_lwp.c
new file mode 100644 (file)
index 0000000..f66a930
--- /dev/null
@@ -0,0 +1,238 @@
+/*
+ * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted only
+ * as authorized by the OpenLDAP Public License.  A copy of this
+ * license is available at http://www.OpenLDAP.org/license.html or
+ * in file LICENSE in the top-level directory of the distribution.
+ */
+
+/* thr_lwp.c - wrappers around SunOS LWP threads */
+
+/* BUGS:
+ * - slurpd calls the get_stack/free_stack functions. Should be fixed, so
+ *   they can become static.
+ */
+
+#include "portable.h"
+#include "ldap_pvt_thread.h"
+
+#if defined( HAVE_LWP )
+
+/*************
+ *           *
+ * SunOS LWP *
+ *           *
+ *************/
+#include <stdio.h>
+
+#include <ac/time.h>
+#include <ac/socket.h>
+
+#include "lber.h"
+#include "ldap.h"
+#include "ldap_log.h"
+
+#include <lwp/lwp.h>
+#include <lwp/stackdep.h>
+
+#define MAX_STACK      51200
+#define MAX_THREADS    20
+
+/*
+ * Initialize LWP by spinning of a schedular
+ */
+int
+ldap_pvt_thread_initialize( void )
+{
+       thread_t                tid;
+       stkalign_t              *stack;
+       int                     stackno;
+
+       if (( stack = get_stack( &stackno )) == NULL ) {
+               return -1;
+       }
+
+       lwp_create( &tid, lwp_scheduler, MINPRIO, 0, stack, 1, stackno );
+       return 0;
+}
+
+struct stackinfo {
+       int             stk_inuse;
+       stkalign_t      *stk_stack;
+};
+
+static struct stackinfo        *stacks;
+
+stkalign_t * ldap_pvt_thread_get_stack( int *stacknop )
+{
+       int     i;
+
+       if ( stacks == NULL ) {
+               stacks = (struct stackinfo *) ch_calloc( 1, MAX_THREADS *
+                   sizeof(struct stackinfo) );
+       }
+
+       for ( i = 0; i < MAX_THREADS; i++ ) {
+               if ( stacks[i].stk_inuse == 0 ) {
+                       break;
+               }
+       }
+
+       if ( i == MAX_THREADS ) {
+               Debug( LDAP_DEBUG_ANY,
+                   "no more stacks (max %d) - increase MAX_THREADS for more",
+                   MAX_THREADS, 0, 0 );
+               return( NULL );
+       }
+
+       if ( stacks[i].stk_stack == NULL ) {
+               stacks[i].stk_stack = (stkalign_t *) malloc(
+                   (MAX_STACK / sizeof(stkalign_t) + 1 )
+                   * sizeof(stkalign_t) );
+       }
+
+       *stacknop = i;
+       stacks[i].stk_inuse = 1;
+       return( stacks[i].stk_stack + MAX_STACK / sizeof(stkalign_t) );
+}
+
+void
+ldap_pvt_thread_free_stack( int        stackno )
+{
+       if ( stackno < 0 || stackno > MAX_THREADS ) {
+               Debug( LDAP_DEBUG_ANY, "free_stack of bogus stack %d",
+                   stackno, 0, 0 );
+       }
+
+       stacks[stackno].stk_inuse = 0;
+}
+
+static void
+lwp_create_stack( void *(*func)(), void *arg, int stackno )
+{
+       (*func)( arg );
+
+       ldap_pvt_thread_free_stack( stackno );
+}
+
+int 
+ldap_pvt_thread_create( ldap_pvt_thread_t * thread, 
+       int detach,
+       void *(*start_routine)( void *),
+       void *arg)
+{
+       stkalign_t      *stack;
+       int             stackno;
+
+       if ( (stack = ldap_pvt_thread_get_stack( &stackno )) == NULL ) {
+               return( -1 );
+       }
+       return( lwp_create( thread, lwp_create_stack, MINPRIO, 0, 
+                          stack, 3, start_routine, arg, stackno ) );
+}
+
+void 
+ldap_pvt_thread_exit( void *retval )
+{
+       lwp_destroy( SELF );
+}
+
+int 
+ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **thread_return )
+{
+       lwp_join( thread );
+       return 0;
+}
+
+int 
+ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
+{
+       return 0;
+}
+
+int 
+ldap_pvt_thread_yield( void )
+{
+       lwp_yield( SELF );
+       return 0;
+}
+
+int 
+ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond )
+{
+       /*
+        * lwp cv_create requires the monitor id be passed in
+        * when the cv is created, pthreads passes it when the
+        * condition is waited for.  so, we fake the creation
+        * here and actually do it when the cv is waited for
+        * later.
+        */
+
+       cond->lcv_created = 0;
+
+       return( 0 );
+}
+
+int 
+ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond )
+{
+       return( cond->lcv_created ? cv_notify( cv->lcv_cv ) : 0 );
+}
+
+int 
+ldap_pvt_thread_cond_wait( ldap_pvt_thread_cond_t *cond, 
+                     ldap_pvt_thread_mutex_t *mutex )
+{
+       if ( ! cond->lcv_created ) {
+               cv_create( &cond->lcv_cv, *mutex );
+               cond->lcv_created = 1;
+       }
+
+       return( cv_wait( cond->lcv_cv ) );      
+}
+
+int 
+ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex )
+{
+       return( mon_create( mutex ) );
+}
+
+int 
+ldap_pvt_thread_mutex_destroy( ldap_pvt_thread_mutex_t *mutex )
+{
+       return( mon_destroy( *mutex ) );
+}
+
+int 
+ldap_pvt_thread_mutex_lock( ldap_pvt_thread_mutex_t *mutex )
+{
+       return( mon_enter( *mutex ) );
+}
+
+int 
+ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_t *mutex )
+{
+       return( mon_exit( *mutex ) );
+}
+
+int
+ldap_pvt_thread_mutex_trylock( ldap_pvt_thread_mutex_t *mp )
+{
+       return( mon_cond_enter( *mp ) );
+}
+
+int
+ldap_pvt_thread_cond_destroy( ldap_pvt_thread_cond_t *cv )
+{
+       return( cv->lcv_created ? cv_destroy( cv->lcv_cv ) : 0 );
+}
+
+int
+ldap_pvt_thread_cond_broadcast( ldap_pvt_thread_cond_t *cv )
+{
+       return( cv->lcv_created ? cv_broadcast( cv->lcv_cv ) : 0 );
+}
+
+#endif /* HAVE_LWP */
diff --git a/libraries/liblthread/thr_nt.c b/libraries/liblthread/thr_nt.c
new file mode 100644 (file)
index 0000000..60276ab
--- /dev/null
@@ -0,0 +1,142 @@
+/*
+ * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted only
+ * as authorized by the OpenLDAP Public License.  A copy of this
+ * license is available at http://www.OpenLDAP.org/license.html or
+ * in file LICENSE in the top-level directory of the distribution.
+ */
+
+/* thr_nt.c - wrapper around NT threads */
+
+#include "portable.h"
+#include "ldap_pvt_thread.h"
+
+#if defined( HAVE_NT_THREADS )
+
+int
+ldap_pvt_thread_initialize( void )
+{
+       return 0;
+}
+
+int 
+ldap_pvt_thread_create( ldap_pvt_thread_t * thread, 
+       int detach,
+       void *(*start_routine)( void *),
+       void *arg)
+{
+       *thread = (ldap_pvt_thread_t)_beginthread( (void *) start_routine, 
+                                               0, arg );
+        return ( (unsigned long)*thread == -1 ? -1 : 0 );
+}
+       
+void 
+ldap_pvt_thread_exit( void *retval )
+{
+       _endthread( );
+}
+
+int 
+ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **thread_return )
+{
+       DWORD status;
+       status = WaitForSingleObject( thread, INFINITE );
+       if (status == WAIT_FAILED) {
+               return -1;
+       }
+       return 0;
+}
+
+int 
+ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
+{
+       return 0;
+}
+
+int 
+ldap_pvt_thread_yield( void )
+{
+       return 0;
+}
+
+int 
+ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond )
+{
+       *cond = CreateEvent( NULL, FALSE, FALSE, NULL );
+       return( 0 );
+}
+
+int
+ldap_pvt_thread_cond_destroy( ldap_pvt_thread_cond_t *cv )
+{
+       CloseHandle( *cv );
+       return( 0 );
+}
+
+int 
+ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond )
+{
+       SetEvent( *cond );
+       return( 0 );
+}
+
+int 
+ldap_pvt_thread_cond_wait( ldap_pvt_thread_cond_t *cond, 
+                         ldap_pvt_thread_mutex_t *mutex )
+{
+       ReleaseMutex( *mutex );
+       WaitForSingleObject( *cond, INFINITE );
+       WaitForSingleObject( *mutex, INFINITE );
+       return( 0 );
+}
+
+int
+ldap_pvt_thread_cond_broadcast( ldap_pvt_thread_cond_t *cv )
+{
+       SetEvent( *cv );
+       return( 0 );
+}
+
+int 
+ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex )
+{
+       *mutex = CreateMutex( NULL, 0, NULL );
+       return ( 0 );
+}
+
+int 
+ldap_pvt_thread_mutex_destroy( ldap_pvt_thread_mutex_t *mutex )
+{
+       CloseHandle( *mutex );
+       return ( 0 );   
+}
+
+int 
+ldap_pvt_thread_mutex_lock( ldap_pvt_thread_mutex_t *mutex )
+{
+       WaitForSingleObject( *mutex, INFINITE );
+       return ( 0 );
+}
+
+int 
+ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_t *mutex )
+{
+       ReleaseMutex( *mutex );
+       return ( 0 );
+}
+
+int
+ldap_pvt_thread_mutex_trylock( ldap_pvt_thread_mutex_t *mp )
+{
+       DWORD status;
+
+       status = WaitForSingleObject( *mp, 0 );
+       if ( (status == WAIT_FAILED) || (status == WAIT_TIMEOUT) )
+               return 0;
+       else
+               return 1;
+}
+
+#endif
diff --git a/libraries/liblthread/thr_posix.c b/libraries/liblthread/thr_posix.c
new file mode 100644 (file)
index 0000000..09f283d
--- /dev/null
@@ -0,0 +1,174 @@
+/*
+ * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted only
+ * as authorized by the OpenLDAP Public License.  A copy of this
+ * license is available at http://www.OpenLDAP.org/license.html or
+ * in file LICENSE in the top-level directory of the distribution.
+ */
+
+/* thr_posix.c - wrapper around posix and posixish thread implementations.
+ */
+
+#include "portable.h"
+#include "ldap_pvt_thread.h"
+
+#if defined( HAVE_PTHREADS )
+
+int
+ldap_pvt_thread_initialize( void )
+{
+#if defined( LDAP_THREAD_CONCURRENCY ) && HAVE_PTHREAD_SETCONCURRENCY
+       ldap_pvt_thread_setconcurrency( LDAP_THREAD_CONCURRENCY );
+#endif
+       return 0;
+}
+
+#ifdef HAVE_PTHREAD_SETCONCURRENCY
+int
+ldap_pvt_thread_set_concurrency(int n)
+{
+#ifdef HAVE_PTHREAD_SETCONCURRENCY
+       return pthread_setconcurrency( n );
+#elif HAVE_THR_SETCONCURRENCY
+       return pthread_setconcurrency( n );
+#else
+       return 0;
+#endif
+}
+#endif
+
+#ifdef HAVE_PTHREAD_GETCONCURRENCY
+int
+ldap_pvt_thread_get_concurrency(void)
+{
+#ifdef HAVE_PTHREAD_GETCONCURRENCY
+       return pthread_getconcurrency();
+#elif HAVE_THR_GETCONCURRENCY
+       return pthread_getconcurrency();
+#else
+       return 0;
+#endif
+}
+#endif
+
+int 
+ldap_pvt_thread_create( ldap_pvt_thread_t * thread,
+       int detach,
+       void *(*start_routine)( void * ),
+       void *arg)
+{
+       int rtn = pthread_create( thread, NULL, start_routine, arg );
+
+       if( detach ) {
+#ifdef HAVE_PTHREADS_FINAL
+               pthread_detach( *thread );
+#else
+               pthread_detach( thread );
+#endif
+       }
+       return rtn;
+}
+
+void 
+ldap_pvt_thread_exit( void *retval )
+{
+       pthread_exit( retval );
+}
+
+int 
+ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **thread_return )
+{
+#if !defined( HAVE_PTHREADS_FINAL )
+       void *dummy;
+       if (thread_return==NULL)
+         thread_return=&dummy;
+#endif 
+       return pthread_join( thread, thread_return );
+}
+
+int 
+ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
+{
+#ifdef HAVE_PTHREAD_KILL
+       return pthread_kill( thread, signo );
+#else
+       /* pthread package with DCE */
+       if (kill( getpid(), sig )<0)
+               return errno;
+       return 0;
+#endif
+}
+
+int 
+ldap_pvt_thread_yield( void )
+{
+#ifdef HAVE_SCHED_YIELD
+       return sched_yield();
+#elif HAVE_PTHREAD_YIELD
+       return pthread_yield();
+#elif HAVE_THR_YIELD
+       return thr_yield();
+#else
+       return 0;
+#endif   
+}
+
+int 
+ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond )
+{
+       return pthread_cond_init( cond, NULL );
+}
+
+int 
+ldap_pvt_thread_cond_destroy( ldap_pvt_thread_cond_t *cond )
+{
+       return pthread_cond_destroy( cond );
+}
+       
+int 
+ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond )
+{
+       return pthread_cond_signal( cond );
+}
+
+int
+ldap_pvt_thread_cond_broadcast( ldap_pvt_thread_cond_t *cond )
+{
+       return pthread_cond_broadcast( cond );
+}
+
+int 
+ldap_pvt_thread_cond_wait( ldap_pvt_thread_cond_t *cond, 
+                     ldap_pvt_thread_mutex_t *mutex )
+{
+       return pthread_cond_wait( cond, mutex );
+}
+
+int 
+ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex )
+{
+       return pthread_mutex_init( mutex, NULL );
+}
+
+int 
+ldap_pvt_thread_mutex_destroy( ldap_pvt_thread_mutex_t *mutex )
+{
+       return pthread_mutex_destroy( mutex );
+}
+
+int 
+ldap_pvt_thread_mutex_lock( ldap_pvt_thread_mutex_t *mutex )
+{
+       return pthread_mutex_lock( mutex );
+}
+
+int 
+ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_t *mutex )
+{
+       return pthread_mutex_unlock( mutex );
+}
+
+#endif /* HAVE_PTHREADS */
+
diff --git a/libraries/liblthread/thr_sleep.c b/libraries/liblthread/thr_sleep.c
new file mode 100644 (file)
index 0000000..001bb1a
--- /dev/null
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 1996 Regents of the University of Michigan.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that this notice is preserved and that due credit is given
+ * to the University of Michigan at Ann Arbor. The name of the University
+ * may not be used to endorse or promote products derived from this
+ * software without specific prior written permission. This software
+ * is provided ``as is'' without express or implied warranty.
+ */
+
+/*
+ * ldap_pvt_thread_sleep.c - allow a thread to sleep without putting
+ * the whole process (e.g. pod under lwp) to sleep.
+ *
+ * Contains platform-specific code to allow this:
+ *
+ * Under non-preemptive threads packages like SunOS lwp, tsleep() adds
+ * the thread to a list of sleepers.  The lwp_scheduler process takes
+ * care of resuming suspended threads.
+ *
+ * Under a fully-preemptive threads package, like Solaris threads,
+ * tsleep just calls sleep(), and there is no scheduler thread.  Life
+ * is so much simpler...
+ */
+
+#include "portable.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ac/unistd.h>                 /* get sleep() */
+
+#if !defined( HAVE_LWP )
+
+/*
+ * Here we assume we have fully preemptive threads and that sleep()
+ * does the right thing.
+ */
+unsigned int
+ldap_pvt_thread_sleep(
+       unsigned int interval
+)
+{
+       sleep( interval );
+       return 0;
+}
+
+#else
+
+unsigned int
+ldap_pvt_thread_sleep(
+       unsigned int interval
+)
+{
+       thread_t                mylwp;
+       tl_t            *t, *nt;
+       time_t          now;
+
+
+       if ( lwp_self( &mylwp ) < 0 ) {
+               return -1;
+       }
+
+       time( &now );
+
+       mon_enter( &sglob->tsl_mon );
+
+       if ( sglob->tsl_list != NULL ) {
+               for ( t = sglob->tsl_list; t != NULL; t = t->tl_next ) {
+                       if ( SAMETHREAD( t->tl_tid, mylwp )) {
+                               /* We're already sleeping? */
+                               t->tl_wake = now + interval;
+                               mon_exit( &sglob->tsl_mon );
+                               lwp_suspend( mylwp );
+                               return 0;
+                       }
+               }
+       }
+
+       nt = (tl_t *) malloc( sizeof( tl_t ));
+
+       nt->tl_next = sglob->tsl_list;
+       nt->tl_wake = now + interval;
+       nt->tl_tid = mylwp;
+       sglob->tsl_list = nt;
+
+       mon_exit( &sglob->tsl_mon );
+
+       lwp_suspend( mylwp );
+       return 0;
+}
+
+/*
+ * The lwp_scheduler thread periodically checks to see if any threads
+ * are due to be resumed.  If there are, it resumes them.  Otherwise,
+ * it computes the lesser of ( 1 second ) or ( the minimum time until
+ * a thread need to be resumed ) and puts itself to sleep for that amount
+ * of time.
+ */
+void
+lwp_scheduler(
+       int             stackno
+)
+{
+       time_t                  now, min;
+       struct timeval          interval;
+       tl_t                    *t;
+
+       while ( !sglob->slurpd_shutdown ) {
+               mon_enter( &sglob->tsl_mon );
+
+               time( &now );
+               min = 0L;
+               if ( sglob->tsl_list != NULL ) {
+                       for ( t = sglob->tsl_list; t != NULL; t = t->tl_next ) {
+                               if (( t->tl_wake  > 0L ) && ( t->tl_wake < now )) {
+                                       lwp_resume( t->tl_tid );
+                                       t->tl_wake = 0L;
+                               }
+
+                               if (( t->tl_wake > now ) && ( t->tl_wake < min )) {
+                                       min =  t->tl_wake;
+                               }
+                       }
+               }
+
+               mon_exit( &sglob->tsl_mon );
+
+               interval.tv_usec = 0L;
+               if ( min == 0L ) {
+                       interval.tv_sec = 1L;
+               } else {
+                       interval.tv_sec = min;
+               }
+
+               lwp_sleep( &interval );
+       }
+
+       mon_enter( &sglob->tsl_mon );
+
+       for ( t = sglob->tsl_list; t != NULL; t = t->tl_next ) {
+               lwp_resume( t->tl_tid );
+       }
+
+       mon_exit( &sglob->tsl_mon );
+
+       free_stack( stackno );
+}
+
+#endif /* HAVE_LWP */
diff --git a/libraries/liblthread/thr_stub.c b/libraries/liblthread/thr_stub.c
new file mode 100644 (file)
index 0000000..0b8f661
--- /dev/null
@@ -0,0 +1,127 @@
+/*
+ * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted only
+ * as authorized by the OpenLDAP Public License.  A copy of this
+ * license is available at http://www.OpenLDAP.org/license.html or
+ * in file LICENSE in the top-level directory of the distribution.
+ */
+
+/* thr_stub.c - stubs for the threads */
+
+#include "portable.h"
+#include "ldap_pvt_thread.h"
+
+#if defined( NO_THREADS )
+
+/***********************************************************************
+ *                                                                     *
+ * no threads package defined for this system - fake ok returns from   *
+ * all threads routines (making it single-threaded).                   *
+ *                                                                     *
+ ***********************************************************************/
+
+int
+ldap_pvt_thread_initialize( void )
+{
+       return 0;
+}
+
+static void* ldap_int_status = NULL;
+
+int 
+ldap_pvt_thread_create( ldap_pvt_thread_t * thread, 
+       int detach,
+       void *(*start_routine)(void *),
+       void *arg)
+{
+       if( ! detach ) ldap_int_status = NULL;
+       start_routine( arg );
+       return 0;
+}
+
+void 
+ldap_pvt_thread_exit( void *retval )
+{
+       if( retval != NULL ) {
+               ldap_int_status = retval;
+       }
+       return;
+}
+
+int 
+ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **status )
+{
+       if(status != NULL) *status = ldap_int_status;
+       return 0;
+}
+
+int 
+ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
+{
+       return 0;
+}
+
+int 
+ldap_pvt_thread_yield( void )
+{
+       return 0;
+}
+
+int 
+ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond )
+{
+       return 0;
+}
+
+int 
+ldap_pvt_thread_cond_destroy( ldap_pvt_thread_cond_t *cond )
+{
+       return 0;
+}
+
+int 
+ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond )
+{
+       return 0;
+}
+
+int 
+ldap_pvt_thread_cond_broadcast( ldap_pvt_thread_cond_t *cond )
+{
+       return 0;
+}
+
+int 
+ldap_pvt_thread_cond_wait( ldap_pvt_thread_cond_t *cond,
+                         ldap_pvt_thread_mutex_t *mutex )
+{
+       return 0;
+}
+
+int 
+ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex )
+{
+       return 0;
+}
+
+int 
+ldap_pvt_thread_mutex_destroy( ldap_pvt_thread_mutex_t *mutex )
+{
+       return 0;
+}
+
+int 
+ldap_pvt_thread_mutex_lock( ldap_pvt_thread_mutex_t *mutex )
+{
+       return 0;
+}
+
+int 
+ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_t *mutex )
+{
+       return 0;
+}
+
+#endif /* NO_THREADS */
diff --git a/libraries/liblthread/thr_thr.c b/libraries/liblthread/thr_thr.c
new file mode 100644 (file)
index 0000000..54f2b6b
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted only
+ * as authorized by the OpenLDAP Public License.  A copy of this
+ * license is available at http://www.OpenLDAP.org/license.html or
+ * in file LICENSE in the top-level directory of the distribution.
+ */
+
+/* thr_thr.c - wrappers around solaris threads */
+
+#include "portable.h"
+#include "ldap_pvt_thread.h"
+
+#if defined( HAVE_THR )
+
+/*******************
+ *                 *
+ * Solaris Threads *
+ *                 *
+ *******************/
+
+int
+ldap_pvt_thread_initialize( void )
+{
+#ifdef LDAP_THREAD_CONCURRENCY
+       thr_setconcurrency( LDAP_THREAD_CONCURRENCY );
+#endif
+       return 0;
+}
+
+int
+ldap_pvt_thread_set_concurrency(int n)
+{
+       return thr_setconcurrency( n );
+}
+
+int
+ldap_pvt_thread_get_concurrency(void)
+{
+       return thr_getconcurrency();
+}
+
+int 
+ldap_pvt_thread_create( ldap_pvt_thread_t * thread, 
+       int detach,
+       void *(*start_routine)( void *),
+       void *arg)
+{
+       return( thr_create( NULL, 0, start_routine, arg,
+               detach ? THR_DETACHED : 0,
+               thread ) );
+}
+
+void 
+ldap_pvt_thread_exit( void *retval )
+{
+       thr_exit( NULL );
+}
+
+int ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **thread_return )
+{
+       thr_join( thread, NULL, thread_return );
+       return 0;
+}
+
+int 
+ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
+{
+       thr_kill( thread, signo );
+       return 0;
+}
+       
+int 
+ldap_pvt_thread_yield( void )
+{
+       thr_yield();
+       return 0;
+}
+
+int 
+ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond )
+{
+       return( cond_init( cond, USYNC_THREAD, NULL ) );
+}
+
+int 
+ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond )
+{
+       return( cond_signal( cond ) );
+}
+
+int
+ldap_pvt_thread_cond_broadcast( ldap_pvt_thread_cond_t *cv )
+{
+       return( cond_broadcast( cv ) );
+}
+
+int 
+ldap_pvt_thread_cond_wait( ldap_pvt_thread_cond_t *cond, 
+                         ldap_pvt_thread_mutex_t *mutex )
+{
+       return( cond_wait( cond, mutex ) );
+}
+
+int
+ldap_pvt_thread_cond_destroy( ldap_pvt_thread_cond_t *cv )
+{
+       return( cond_destroy( cv ) );
+}
+
+int 
+ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex )
+{
+       return( mutex_init( mutex, USYNC_THREAD, NULL ) );
+}
+
+int 
+ldap_pvt_thread_mutex_destroy( ldap_pvt_thread_mutex_t *mutex )
+{
+       return( mutex_destroy( mutex ) );
+}
+
+int 
+ldap_pvt_thread_mutex_lock( ldap_pvt_thread_mutex_t *mutex )
+{
+       return( mutex_lock( mutex ) );
+}
+
+int 
+ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_t *mutex )
+{
+       return( mutex_unlock( mutex ) );
+}
+
+int
+ldap_pvt_thread_mutex_trylock( ldap_pvt_thread_mutex_t *mp )
+{
+       return( mutex_trylock( mp ) );
+}
+
+#endif /* HAVE_THR */
diff --git a/libraries/liblthread/thread.c b/libraries/liblthread/thread.c
deleted file mode 100644 (file)
index 7421746..0000000
+++ /dev/null
@@ -1,634 +0,0 @@
-/* thread.c - glue routines to provide a consistent thread interface */
-
-#include "portable.h"
-
-#include <lthread.h>
-
-#if defined( HAVE_PTHREADS )
-
-#ifndef HAVE_PTHREAD_KILL
-/*
- * Some pthreads packages (ie: DCE) don't have pthread_kill()
- * pthread_kill() routine)
- *
- */
-
-/* ARGSUSED */
-void
-pthread_kill( pthread_t tid, int sig )
-{
-       kill( getpid(), sig );
-}
-#endif /* HAVE_PTHREAD_KILL */
-
-#if !defined(HAVE_SCHED_YIELD) && !defined(HAVE_PTHREAD_YIELD)
-/*
- * Some pthreads packages don't have sched_yield() nor
- * the draft4 pthread_kill() routine, assume it's not
- * needed.
- */
-void
-pthread_yield( void )
-{
-       /* assume pthread implementation is preemptive */
-}
-#endif /* missing sched_yield() */
-
-#elif defined( HAVE_MACH_CTHREADS )
-
-/***********************************************************************
- *                                                                     *
- * under NEXTSTEP or OPENSTEP use CThreads                             *
- * lukeh@xedoc.com.au                                                  *
- *                                                                     *
- ***********************************************************************/
-
-int
-pthread_attr_init( pthread_attr_t *attr )
-{
-       *attr = 0;
-       return( 0 );
-}
-
-int
-pthread_attr_destroy( pthread_attr_t *attr )
-{
-       return( 0 );
-}
-
-int
-pthread_attr_getdetachstate( pthread_attr_t *attr, int *detachstate )
-{
-       *detachstate = *attr;
-       return( 0 );
-}
-
-int
-pthread_attr_setdetachstate( pthread_attr_t *attr, int detachstate )
-{
-       *attr = detachstate;
-       return( 0 );
-}
-
-/* ARGSUSED */
-int
-pthread_create(
-    pthread_t          *tid,
-    pthread_attr_t     *attr,
-    VFP                        func,
-    void               *arg
-)
-{
-       *tid = cthread_fork(func, arg);
-        return ( *tid == NULL ? -1 : 0 );
-}
-
-void
-pthread_yield( void )
-{
-       cthread_yield();
-}
-
-void
-pthread_exit( any_t a )
-{
-       cthread_exit( a );
-}
-
-void
-pthread_join( pthread_t tid, int *pStatus )
-{
-       int status;
-       status = (int) cthread_join ( tid );
-       if (pStatus != NULL)
-               {
-               *pStatus = status;
-               }
-}
-
-/* ARGSUSED */
-void
-pthread_kill( pthread_t tid, int sig )
-{
-       return;
-}
-
-/* ARGSUSED */
-int
-pthread_mutex_init( pthread_mutex_t *mp, pthread_mutexattr_t *attr )
-{
-       mutex_init( mp );
-       mp->name = NULL;
-       return ( 0 );
-}
-
-int
-pthread_mutex_destroy( pthread_mutex_t *mp )
-{
-       mutex_clear( mp );
-       return ( 0 );
-}
-
-int
-pthread_mutex_lock( pthread_mutex_t *mp )
-{
-       mutex_lock( mp );
-       return ( 0 );
-}
-
-int
-pthread_mutex_unlock( pthread_mutex_t *mp )
-{
-       mutex_unlock( mp );
-       return ( 0 );
-}
-
-int
-pthread_mutex_trylock( pthread_mutex_t *mp )
-{
-       return mutex_try_lock( mp );
-}
-
-int
-pthread_cond_init( pthread_cond_t *cv, pthread_condattr_t *attr )
-{
-       condition_init( cv );
-       return( 0 );
-}
-
-int
-pthread_cond_destroy( pthread_cond_t *cv )
-{
-       condition_clear( cv );
-       return( 0 );
-}
-
-int
-pthread_cond_wait( pthread_cond_t *cv, pthread_mutex_t *mp )
-{
-       condition_wait( cv, mp );
-       return( 0 );
-}
-
-int
-pthread_cond_signal( pthread_cond_t *cv )
-{
-       condition_signal( cv );
-       return( 0 );
-}
-
-int
-pthread_cond_broadcast( pthread_cond_t *cv )
-{
-       condition_broadcast( cv );
-       return( 0 );
-}
-
-#elif defined( HAVE_THR )
-
-/*******************
- *                 *
- * Solaris Threads *
- *                 *
- *******************/
-
-#if !defined(__SunOS_5_6)
-int
-pthread_attr_init( pthread_attr_t *attr )
-{
-       *attr = 0;
-       return( 0 );
-}
-
-int
-pthread_attr_destroy( pthread_attr_t *attr )
-{
-       *attr = 0;
-       return( 0 );
-}
-
-int
-pthread_attr_getdetachstate( pthread_attr_t *attr, int *detachstate )
-{
-       *detachstate = *attr;
-       return( 0 );
-}
-
-int
-pthread_attr_setdetachstate( pthread_attr_t *attr, int detachstate )
-{
-       *attr = detachstate;
-       return( 0 );
-}
-
-/* ARGSUSED */
-int
-pthread_create(
-    pthread_t          *tid,
-    pthread_attr_t     *attr,
-    VFP                        func,
-    void               *arg
-)
-{
-       return( thr_create( NULL, 0, func, arg, *attr, tid ) );
-}
-#endif /* ! sunos56 */
-
-void
-pthread_yield( void )
-{
-       thr_yield();
-}
-
-#if !defined(__SunOS_5_6)
-void
-pthread_exit()
-{
-       thr_exit( NULL );
-}
-
-void
-pthread_join( pthread_t tid, int *status )
-{
-       thr_join( tid, NULL, (void **) status );
-}
-
-void
-pthread_kill( pthread_t tid, int sig )
-{
-       thr_kill( tid, sig );
-}
-
-/* ARGSUSED */
-int
-pthread_mutex_init( pthread_mutex_t *mp, pthread_mutexattr_t *attr )
-{
-       return( mutex_init( mp, attr ? *attr : USYNC_THREAD, NULL ) );
-}
-
-int
-pthread_mutex_destroy( pthread_mutex_t *mp )
-{
-       return( mutex_destroy( mp ) );
-}
-
-int
-pthread_mutex_lock( pthread_mutex_t *mp )
-{
-       return( mutex_lock( mp ) );
-}
-
-int
-pthread_mutex_unlock( pthread_mutex_t *mp )
-{
-       return( mutex_unlock( mp ) );
-}
-
-int
-pthread_mutex_trylock( pthread_mutex_t *mp )
-{
-       return( mutex_trylock( mp ) );
-}
-
-int
-pthread_cond_init( pthread_cond_t *cv, pthread_condattr_t *attr )
-{
-       return( cond_init( cv, attr ? *attr : USYNC_THREAD, NULL ) );
-}
-
-int
-pthread_cond_destroy( pthread_cond_t *cv )
-{
-       return( cond_destroy( cv ) );
-}
-
-int
-pthread_cond_wait( pthread_cond_t *cv, pthread_mutex_t *mp )
-{
-       return( cond_wait( cv, mp ) );
-}
-
-int
-pthread_cond_signal( pthread_cond_t *cv )
-{
-       return( cond_signal( cv ) );
-}
-
-int
-pthread_cond_broadcast( pthread_cond_t *cv )
-{
-       return( cond_broadcast( cv ) );
-}
-#endif /* ! sunos56 */
-
-#elif defined( HAVE_LWP )
-
-/*************
- *           *
- * SunOS LWP *
- *           *
- *************/
-
-int
-pthread_attr_init( pthread_attr_t *attr )
-{
-       *attr = 0;
-       return( 0 );
-}
-
-int
-pthread_attr_destroy( pthread_attr_t *attr )
-{
-       return( 0 );
-}
-
-int
-pthread_attr_getdetachstate( pthread_attr_t *attr, int *detachstate )
-{
-       *detachstate = *attr;
-       return( 0 );
-}
-
-int
-pthread_attr_setdetachstate( pthread_attr_t *attr, int detachstate )
-{
-       *attr = detachstate;
-       return( 0 );
-}
-
-static void
-lwp_create_stack( VFP func, void *arg, int stackno )
-{
-       (*func)( arg );
-
-       free_stack( stackno );
-}
-
-/* ARGSUSED */
-int
-pthread_create(
-    pthread_t          *tid,
-    pthread_attr_t     *attr,
-    VFP                        func,
-    void               *arg
-)
-{
-       stkalign_t      *stack;
-       int             stackno;
-
-       if ( (stack = get_stack( &stackno )) == NULL ) {
-               return( -1 );
-       }
-       return( lwp_create( tid, lwp_create_stack, MINPRIO, 0, stack, 3, func,
-           arg, stackno ) );
-}
-
-void
-pthread_yield( void )
-{
-       lwp_yield( SELF );
-}
-
-void
-pthread_exit()
-{
-       lwp_destroy( SELF );
-}
-
-void
-pthread_join( pthread_t tid, int *status )
-{
-       lwp_join( tid );
-}
-
-/* ARGSUSED */
-void
-pthread_kill( pthread_t tid, int sig )
-{
-       return;
-}
-
-/* ARGSUSED */
-int
-pthread_mutex_init( pthread_mutex_t *mp, pthread_mutexattr_t *attr )
-{
-       return( mon_create( mp ) );
-}
-
-int
-pthread_mutex_destroy( pthread_mutex_t *mp )
-{
-       return( mon_destroy( *mp ) );
-}
-
-int
-pthread_mutex_lock( pthread_mutex_t *mp )
-{
-       return( mon_enter( *mp ) );
-}
-
-int
-pthread_mutex_unlock( pthread_mutex_t *mp )
-{
-       return( mon_exit( *mp ) );
-}
-
-int
-pthread_mutex_trylock( pthread_mutex_t *mp )
-{
-       return( mon_cond_enter( *mp ) );
-}
-
-int
-pthread_cond_init( pthread_cond_t *cv, pthread_condattr_t *attr )
-{
-       /*
-        * lwp cv_create requires the monitor id be passed in
-        * when the cv is created, pthreads passes it when the
-        * condition is waited for.  so, we fake the creation
-        * here and actually do it when the cv is waited for
-        * later.
-        */
-
-       cv->lcv_created = 0;
-
-       return( 0 );
-}
-
-int
-pthread_cond_destroy( pthread_cond_t *cv )
-{
-       return( cv->lcv_created ? cv_destroy( cv->lcv_cv ) : 0 );
-}
-
-int
-pthread_cond_wait( pthread_cond_t *cv, pthread_mutex_t *mp )
-{
-       if ( ! cv->lcv_created ) {
-               cv_create( &cv->lcv_cv, *mp );
-               cv->lcv_created = 1;
-       }
-
-       return( cv_wait( cv->lcv_cv ) );
-}
-
-int
-pthread_cond_signal( pthread_cond_t *cv )
-{
-       return( cv->lcv_created ? cv_notify( cv->lcv_cv ) : 0 );
-}
-
-int
-pthread_cond_broadcast( pthread_cond_t *cv )
-{
-       return( cv->lcv_created ? cv_broadcast( cv->lcv_cv ) : 0 );
-}
-
-
-#else
-
-/***********************************************************************
- *                                                                     *
- * no threads package defined for this system - fake ok returns from   *
- * all threads routines (making it single-threaded).                   *
- *                                                                     *
- ***********************************************************************/
-
-/* ARGSUSED */
-int
-pthread_attr_init( pthread_attr_t *attr )
-{
-       return( 0 );
-}
-
-/* ARGSUSED */
-int
-pthread_attr_destroy( pthread_attr_t *attr )
-{
-       return( 0 );
-}
-
-/* ARGSUSED */
-int
-pthread_attr_getdetachstate( pthread_attr_t *attr, int *detachstate )
-{
-       return( 0 );
-}
-
-/* ARGSUSED */
-int
-pthread_attr_setdetachstate( pthread_attr_t *attr, int detachstate )
-{
-       return( 0 );
-}
-
-/* ARGSUSED */
-int
-pthread_create(
-    pthread_t          *tid,
-    pthread_attr_t     *attr,
-    VFP                        func,
-    void               *arg
-)
-{
-       (*func)( arg );
-
-       return( 0 );
-}
-
-void
-pthread_yield( void )
-{
-       return;
-}
-
-void
-pthread_exit()
-{
-       return;
-}
-
-/* ARGSUSED */
-void
-pthread_kill( pthread_t tid, int sig )
-{
-       return;
-}
-
-void
-pthread_join( pthread_t tid, int *status )
-{
-       return;
-}
-
-/* ARGSUSED */
-int
-pthread_mutex_init( pthread_mutex_t *mp, pthread_mutexattr_t *attr )
-{
-       return( 0 );
-}
-
-/* ARGSUSED */
-int
-pthread_mutex_destroy( pthread_mutex_t *mp )
-{
-       return( 0 );
-}
-
-/* ARGSUSED */
-int
-pthread_mutex_lock( pthread_mutex_t *mp )
-{
-       return( 0 );
-}
-
-/* ARGSUSED */
-int
-pthread_mutex_unlock( pthread_mutex_t *mp )
-{
-       return( 0 );
-}
-
-/* ARGSUSED */
-int
-pthread_mutex_trylock( pthread_mutex_t *mp )
-{
-       return( 0 );
-}
-
-/* ARGSUSED */
-int
-pthread_cond_init( pthread_cond_t *cv, pthread_condattr_t *attr )
-{
-       return( 0 );
-}
-
-/* ARGSUSED */
-int
-pthread_cond_destroy( pthread_cond_t *cv )
-{
-       return( 0 );
-}
-
-/* ARGSUSED */
-int
-pthread_cond_wait( pthread_cond_t *cv, pthread_mutex_t *mp )
-{
-       return( 0 );
-}
-
-/* ARGSUSED */
-int
-pthread_cond_signal( pthread_cond_t *cv )
-{
-       return( 0 );
-}
-
-/* ARGSUSED */
-int
-pthread_cond_broadcast( pthread_cond_t *cv )
-{
-       return( 0 );
-}
-
-#endif /* no threads package */
index d3f3cd48962eafb376f3d4b82a5d500d8369088f..4b5986e585eac6872d069a8ee85f445ae3f0d90e 100644 (file)
@@ -50,19 +50,19 @@ do_abandon(
         * flag and abort the operation at a convenient time.
         */
 
-       pthread_mutex_lock( &conn->c_opsmutex );
+       ldap_pvt_thread_mutex_lock( &conn->c_opsmutex );
        for ( o = conn->c_ops; o != NULL; o = o->o_next ) {
                if ( o->o_msgid == id )
                        break;
        }
 
        if ( o != NULL ) {
-               pthread_mutex_lock( &o->o_abandonmutex );
+               ldap_pvt_thread_mutex_lock( &o->o_abandonmutex );
                o->o_abandon = 1;
-               pthread_mutex_unlock( &o->o_abandonmutex );
+               ldap_pvt_thread_mutex_unlock( &o->o_abandonmutex );
        } else {
                Debug( LDAP_DEBUG_TRACE, "do_abandon: op not found\n", 0, 0,
                    0 );
        }
-       pthread_mutex_unlock( &conn->c_opsmutex );
+       ldap_pvt_thread_mutex_unlock( &conn->c_opsmutex );
 }
index 2247a6b9c3eeb622f707111b797857bc2df6de01..e128d81af74929c3a25e55e3c845a240a3edfc40 100644 (file)
@@ -181,7 +181,7 @@ add_created_attrs( Operation *op, Entry *e )
        }
        attr_merge( e, "creatorsname", bvals );
 
-       pthread_mutex_lock( &currenttime_mutex );
+       ldap_pvt_thread_mutex_lock( &currenttime_mutex );
 #ifndef LDAP_LOCALTIME
        ltm = gmtime( &currenttime );
        strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm );
@@ -189,7 +189,7 @@ add_created_attrs( Operation *op, Entry *e )
        ltm = localtime( &currenttime );
        strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm );
 #endif
-       pthread_mutex_unlock( &currenttime_mutex );
+       ldap_pvt_thread_mutex_unlock( &currenttime_mutex );
 
        bv.bv_val = buf;
        bv.bv_len = strlen( bv.bv_val );
index 147b191b7b0a24ccfd0730b64a89ecf73939310f..248f31efef26e39930b5c1dc8392af2fd446739c 100644 (file)
@@ -28,17 +28,17 @@ ldbm_back_add(
        Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_add: %s\n", e->e_dn, 0, 0);
 
        /* nobody else can add until we lock our parent */
-       pthread_mutex_lock(&li->li_add_mutex);
+       ldap_pvt_thread_mutex_lock(&li->li_add_mutex);
 
        if ( ( dn2id( be, e->e_ndn ) ) != NOID ) {
-               pthread_mutex_unlock(&li->li_add_mutex);
+               ldap_pvt_thread_mutex_unlock(&li->li_add_mutex);
                entry_free( e );
                send_ldap_result( conn, op, LDAP_ALREADY_EXISTS, "", "" );
                return( -1 );
        }
 
        if ( global_schemacheck && oc_schema_check( e ) != 0 ) {
-               pthread_mutex_unlock(&li->li_add_mutex);
+               ldap_pvt_thread_mutex_unlock(&li->li_add_mutex);
 
                Debug( LDAP_DEBUG_TRACE, "entry failed schema check\n",
                        0, 0, 0 );
@@ -60,7 +60,7 @@ ldbm_back_add(
 
                /* get parent with writer lock */
                if ( (p = dn2entry_w( be, pdn, &matched )) == NULL ) {
-                       pthread_mutex_unlock(&li->li_add_mutex);
+                       ldap_pvt_thread_mutex_unlock(&li->li_add_mutex);
                        Debug( LDAP_DEBUG_TRACE, "parent does not exist\n", 0,
                            0, 0 );
                        send_ldap_result( conn, op, LDAP_NO_SUCH_OBJECT,
@@ -76,7 +76,7 @@ ldbm_back_add(
                }
 
                /* don't need the add lock anymore */
-               pthread_mutex_unlock(&li->li_add_mutex);
+               ldap_pvt_thread_mutex_unlock(&li->li_add_mutex);
 
                free(pdn);
 
@@ -102,7 +102,7 @@ ldbm_back_add(
        } else {
                /* no parent, must be adding entry to root */
                if ( ! be_isroot( be, op->o_ndn ) ) {
-                       pthread_mutex_unlock(&li->li_add_mutex);
+                       ldap_pvt_thread_mutex_unlock(&li->li_add_mutex);
                        Debug( LDAP_DEBUG_TRACE, "no parent & not root\n", 0,
                            0, 0 );
                        send_ldap_result( conn, op, LDAP_INSUFFICIENT_ACCESS,
@@ -116,9 +116,9 @@ ldbm_back_add(
                 * no parent, acquire the root write lock
                 * and release the add lock.
                 */
-               pthread_mutex_lock(&li->li_root_mutex);
+               ldap_pvt_thread_mutex_lock(&li->li_root_mutex);
                rootlock = 1;
-               pthread_mutex_unlock(&li->li_add_mutex);
+               ldap_pvt_thread_mutex_unlock(&li->li_add_mutex);
        }
 
        /* acquire required reader/writer lock */
@@ -130,7 +130,7 @@ ldbm_back_add(
 
                if ( rootlock ) {
                        /* release root lock */
-                       pthread_mutex_unlock(&li->li_root_mutex);
+                       ldap_pvt_thread_mutex_unlock(&li->li_root_mutex);
                }
 
                Debug( LDAP_DEBUG_ANY, "add: could not lock entry\n",
@@ -156,7 +156,7 @@ ldbm_back_add(
                }
                if ( rootlock ) {
                        /* release root lock */
-                       pthread_mutex_unlock(&li->li_root_mutex);
+                       ldap_pvt_thread_mutex_unlock(&li->li_root_mutex);
                }
 
                Debug( LDAP_DEBUG_ANY, "cache_add_entry_lock failed\n", 0, 0,
@@ -226,7 +226,7 @@ return_results:;
 
        if ( rootlock ) {
                /* release root lock */
-               pthread_mutex_unlock(&li->li_root_mutex);
+               ldap_pvt_thread_mutex_unlock(&li->li_root_mutex);
        }
 
        cache_set_state( &li->li_cache, e, 0 );
index 95b1134d002e19d19c8a4ec0f5a79d90e149f9f2..032b3cb77778013201e1355cf38d2b859ce8c7e9 100644 (file)
@@ -66,7 +66,7 @@ struct cache {
        Avlnode         *c_idtree;
        Entry           *c_lruhead;     /* lru - add accessed entries here */
        Entry           *c_lrutail;     /* lru - rem lru entries from here */
-       pthread_mutex_t c_mutex;
+       ldap_pvt_thread_mutex_t c_mutex;
 };
 
 /* for the cache of open index files */
@@ -112,9 +112,9 @@ struct ldbminfo {
        ID                      li_nextid_wrote;
 #endif
        char            *li_nextid_file;
-       pthread_mutex_t         li_root_mutex;
-       pthread_mutex_t         li_add_mutex;
-       pthread_mutex_t         li_nextid_mutex;
+       ldap_pvt_thread_mutex_t         li_root_mutex;
+       ldap_pvt_thread_mutex_t         li_add_mutex;
+       ldap_pvt_thread_mutex_t         li_nextid_mutex;
        int                     li_mode;
        char                    *li_directory;
        struct cache            li_cache;
@@ -122,8 +122,8 @@ struct ldbminfo {
        int                     li_dbcachesize;
        int                     li_dbcachewsync;
        struct dbcache          li_dbcache[MAXDBCACHE];
-       pthread_mutex_t         li_dbcache_mutex;
-       pthread_cond_t          li_dbcache_cv;
+       ldap_pvt_thread_mutex_t         li_dbcache_mutex;
+       ldap_pvt_thread_cond_t          li_dbcache_cv;
 };
 
 #include "proto-back-ldbm.h"
index 6b8a972a28a1c2c3fc6dcf02447ef2f5a3891417..ac461e7668f04296c1d3a498d063864ba0eae960 100644 (file)
@@ -34,7 +34,7 @@ crypted_value_find(
                        int result;
 
 #ifdef SLAPD_CRYPT
-                       pthread_mutex_lock( &crypt_mutex );
+                       ldap_pvt_thread_mutex_lock( &crypt_mutex );
 #endif
 
                        result = lutil_passwd(
@@ -42,7 +42,7 @@ crypted_value_find(
                                (char*) vals[i]->bv_val);
 
 #ifdef SLAPD_CRYPT
-                       pthread_mutex_unlock( &crypt_mutex );
+                       ldap_pvt_thread_mutex_unlock( &crypt_mutex );
 #endif
 
                        return result;
index a9c31cc3eb68bff427e6c6193ef39255228d6610..add8693393c4f8f353133cf8bc0c8fb21350c46e 100644 (file)
@@ -50,26 +50,26 @@ void
 cache_set_state( struct cache *cache, Entry *e, int state )
 {
        /* set cache mutex */
-       pthread_mutex_lock( &cache->c_mutex );
+       ldap_pvt_thread_mutex_lock( &cache->c_mutex );
 
        e->e_state = state;
 
        /* free cache mutex */
-       pthread_mutex_unlock( &cache->c_mutex );
+       ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
 }
 
 static void
 cache_return_entry( struct cache *cache, Entry *e )
 {
        /* set cache mutex */
-       pthread_mutex_lock( &cache->c_mutex );
+       ldap_pvt_thread_mutex_lock( &cache->c_mutex );
 
        if ( --e->e_refcnt == 0 && e->e_state == ENTRY_STATE_DELETED ) {
                entry_free( e );
        }
 
        /* free cache mutex */
-       pthread_mutex_unlock( &cache->c_mutex );
+       ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
 }
 
 static void
@@ -136,7 +136,7 @@ cache_add_entry_lock(
        Entry   *ee;
 
        /* set cache mutex */
-       pthread_mutex_lock( &cache->c_mutex );
+       ldap_pvt_thread_mutex_lock( &cache->c_mutex );
 
        if ( avl_insert( &cache->c_dntree, (caddr_t) e,
                cache_entrydn_cmp, avl_dup_error ) != 0 )
@@ -146,7 +146,7 @@ cache_add_entry_lock(
                    e->e_dn, e->e_id, 0 );
 
                /* free cache mutex */
-               pthread_mutex_unlock( &cache->c_mutex );
+               ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
                return( 1 );
        }
 
@@ -167,7 +167,7 @@ cache_add_entry_lock(
                }
 
                /* free cache mutex */
-               pthread_mutex_unlock( &cache->c_mutex );
+               ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
                return( -1 );
        }
 
@@ -202,7 +202,7 @@ cache_add_entry_lock(
 
                        /* XXX check for writer lock - should also check no readers pending */
 #ifdef LDAP_DEBUG
-                       assert(!pthread_rdwr_rwchk_np(&e->e_rdwr));
+                       assert(!ldap_pvt_thread_rdwr_rwchk(&e->e_rdwr));
 #endif
 
                        /* delete from cache and lru q */
@@ -213,7 +213,7 @@ cache_add_entry_lock(
        }
 
        /* free cache mutex */
-       pthread_mutex_unlock( &cache->c_mutex );
+       ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
        return( 0 );
 }
 
@@ -233,7 +233,7 @@ cache_find_entry_dn2id(
        ID                      id;
 
        /* set cache mutex */
-       pthread_mutex_lock( &cache->c_mutex );
+       ldap_pvt_thread_mutex_lock( &cache->c_mutex );
 
        e.e_dn = dn;
        e.e_ndn = dn_normalize_case( ch_strdup( dn ) );
@@ -253,7 +253,7 @@ cache_find_entry_dn2id(
                        ep->e_state == ENTRY_STATE_CREATING )
                {
                        /* free cache mutex */
-                       pthread_mutex_unlock( &cache->c_mutex );
+                       ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
                        return( NOID );
                }
 
@@ -277,7 +277,7 @@ cache_find_entry_dn2id(
                        /* free reader lock */
                        entry_rdwr_unlock(ep, 0);
                        /* free cache mutex */
-                       pthread_mutex_unlock( &cache->c_mutex );
+                       ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
 
                        return( NOID );
                }
@@ -289,7 +289,7 @@ cache_find_entry_dn2id(
                entry_rdwr_unlock(ep, 0);
 
                /* free cache mutex */
-               pthread_mutex_unlock( &cache->c_mutex );
+               ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
 
                cache_return_entry( &li->li_cache, ep );
 
@@ -299,7 +299,7 @@ cache_find_entry_dn2id(
        free(e.e_ndn);
 
        /* free cache mutex */
-       pthread_mutex_unlock( &cache->c_mutex );
+       ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
 
        return( NOID );
 }
@@ -319,7 +319,7 @@ cache_find_entry_id(
        Entry   *ep;
 
        /* set cache mutex */
-       pthread_mutex_lock( &cache->c_mutex );
+       ldap_pvt_thread_mutex_lock( &cache->c_mutex );
 
        e.e_id = id;
 
@@ -337,7 +337,7 @@ cache_find_entry_id(
                        ep->e_state == ENTRY_STATE_CREATING )
                {
                        /* free cache mutex */
-                       pthread_mutex_unlock( &cache->c_mutex );
+                       ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
                        return( NULL );
                }
                /* XXX is this safe without writer lock? */
@@ -361,7 +361,7 @@ cache_find_entry_id(
                        entry_rdwr_unlock(ep, 0);
 
                        /* free cache mutex */
-                       pthread_mutex_unlock( &cache->c_mutex );
+                       ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
                        return( NULL );
                }
 
@@ -371,13 +371,13 @@ cache_find_entry_id(
                }
 
                /* free cache mutex */
-               pthread_mutex_unlock( &cache->c_mutex );
+               ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
 
                return( ep );
        }
 
        /* free cache mutex */
-       pthread_mutex_unlock( &cache->c_mutex );
+       ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
 
        return( NULL );
 }
@@ -405,16 +405,16 @@ cache_delete_entry(
 
        /* XXX check for writer lock - should also check no readers pending */
 #ifdef LDAP_DEBUG
-       assert(pthread_rdwr_wchk_np(&e->e_rdwr));
+       assert(ldap_pvt_thread_rdwr_wchk(&e->e_rdwr));
 #endif
 
        /* set cache mutex */
-       pthread_mutex_lock( &cache->c_mutex );
+       ldap_pvt_thread_mutex_lock( &cache->c_mutex );
 
        rc = cache_delete_entry_internal( cache, e );
 
        /* free cache mutex */
-       pthread_mutex_unlock( &cache->c_mutex );
+       ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
        return( rc );
 }
 
index 7254c6f4c0e7701364d395a2bbed67141014ce10..066a71d8ca36a8e1c3c6a847bb69da8fdd08f363 100644 (file)
@@ -40,12 +40,12 @@ ldbm_cache_open(
            flags, li->li_mode );
 
        lru = 0;
-       pthread_mutex_lock( &currenttime_mutex );
+       ldap_pvt_thread_mutex_lock( &currenttime_mutex );
        curtime = currenttime;
-       pthread_mutex_unlock( &currenttime_mutex );
+       ldap_pvt_thread_mutex_unlock( &currenttime_mutex );
        oldtime = curtime;
 
-       pthread_mutex_lock( &li->li_dbcache_mutex );
+       ldap_pvt_thread_mutex_lock( &li->li_dbcache_mutex );
        for ( i = 0; i < MAXDBCACHE && li->li_dbcache[i].dbc_name != NULL;
            i++ ) {
                /* already open - return it */
@@ -53,7 +53,7 @@ ldbm_cache_open(
                        li->li_dbcache[i].dbc_refcnt++;
                        Debug( LDAP_DEBUG_TRACE,
                            "<= ldbm_cache_open (cache %d)\n", i, 0, 0 );
-                       pthread_mutex_unlock( &li->li_dbcache_mutex );
+                       ldap_pvt_thread_mutex_unlock( &li->li_dbcache_mutex );
                        return( &li->li_dbcache[i] );
                }
 
@@ -74,7 +74,7 @@ ldbm_cache_open(
                            0, 0, 0 );
                        lru = -1;
                        while ( lru == -1 ) {
-                               pthread_cond_wait( &li->li_dbcache_cv,
+                               ldap_pvt_thread_cond_wait( &li->li_dbcache_cv,
                                    &li->li_dbcache_mutex );
                                for ( i = 0; i < MAXDBCACHE; i++ ) {
                                        if ( li->li_dbcache[i].dbc_refcnt
@@ -97,7 +97,7 @@ ldbm_cache_open(
                    "<= ldbm_cache_open NULL \"%s\" errno %d reason \"%s\")\n",
                    buf, errno, errno > -1 && errno < sys_nerr ?
                    sys_errlist[errno] : "unknown" );
-               pthread_mutex_unlock( &li->li_dbcache_mutex );
+               ldap_pvt_thread_mutex_unlock( &li->li_dbcache_mutex );
                return( NULL );
        }
        li->li_dbcache[i].dbc_name = ch_strdup( buf );
@@ -118,7 +118,7 @@ ldbm_cache_open(
            li->li_dbcache[i].dbc_blksize, li->li_dbcache[i].dbc_maxids,
            li->li_dbcache[i].dbc_maxindirect );
        Debug( LDAP_DEBUG_TRACE, "<= ldbm_cache_open (opened %d)\n", i, 0, 0 );
-       pthread_mutex_unlock( &li->li_dbcache_mutex );
+       ldap_pvt_thread_mutex_unlock( &li->li_dbcache_mutex );
        return( &li->li_dbcache[i] );
 }
 
@@ -127,11 +127,11 @@ ldbm_cache_close( Backend *be, struct dbcache *db )
 {
        struct ldbminfo *li = (struct ldbminfo *) be->be_private;
 
-       pthread_mutex_lock( &li->li_dbcache_mutex );
+       ldap_pvt_thread_mutex_lock( &li->li_dbcache_mutex );
        if ( --db->dbc_refcnt == 0 ) {
-               pthread_cond_signal( &li->li_dbcache_cv );
+               ldap_pvt_thread_cond_signal( &li->li_dbcache_cv );
        }
-       pthread_mutex_unlock( &li->li_dbcache_mutex );
+       ldap_pvt_thread_mutex_unlock( &li->li_dbcache_mutex );
 }
 
 void
@@ -139,14 +139,14 @@ ldbm_cache_really_close( Backend *be, struct dbcache *db )
 {
        struct ldbminfo *li = (struct ldbminfo *) be->be_private;
 
-       pthread_mutex_lock( &li->li_dbcache_mutex );
+       ldap_pvt_thread_mutex_lock( &li->li_dbcache_mutex );
        if ( --db->dbc_refcnt == 0 ) {
-               pthread_cond_signal( &li->li_dbcache_cv );
+               ldap_pvt_thread_cond_signal( &li->li_dbcache_cv );
                ldbm_close( db->dbc_db );
                free( db->dbc_name );
                db->dbc_name = NULL;
        }
-       pthread_mutex_unlock( &li->li_dbcache_mutex );
+       ldap_pvt_thread_mutex_unlock( &li->li_dbcache_mutex );
 }
 
 void
@@ -155,7 +155,7 @@ ldbm_cache_flush_all( Backend *be )
        struct ldbminfo *li = (struct ldbminfo *) be->be_private;
        int             i;
 
-       pthread_mutex_lock( &li->li_dbcache_mutex );
+       ldap_pvt_thread_mutex_lock( &li->li_dbcache_mutex );
        for ( i = 0; i < MAXDBCACHE; i++ ) {
                if ( li->li_dbcache[i].dbc_name != NULL ) {
                        Debug( LDAP_DEBUG_TRACE, "ldbm flushing db (%s)\n",
@@ -163,7 +163,7 @@ ldbm_cache_flush_all( Backend *be )
                        ldbm_sync( li->li_dbcache[i].dbc_db );
                }
        }
-       pthread_mutex_unlock( &li->li_dbcache_mutex );
+       ldap_pvt_thread_mutex_unlock( &li->li_dbcache_mutex );
 }
 
 Datum
index a1145acee350e8301568c0e18f4fc936cedfbe49..5048b2926def523823a7d3750e50fee96336f764 100644 (file)
@@ -41,7 +41,7 @@ ldbm_back_delete(
 
        Debug (LDAP_DEBUG_TRACE,
                "rdwr_Xchk: readers_reading: %d writer_writing: %d\n",
-               e->e_rdwr.readers_reading, e->e_rdwr.writer_writing, 0);
+               e->e_rdwr.lt_readers_reading, e->e_rdwr.lt_writer_writing, 0);
 
        /* check for deleted */
 
@@ -67,12 +67,13 @@ ldbm_back_delete(
 
        Debug (LDAP_DEBUG_TRACE,
                "rdwr_Xchk: readers_reading: %d writer_writing: %d\n",
-               e->e_rdwr.readers_reading, e->e_rdwr.writer_writing, 0);
+               e->e_rdwr.lt_readers_reading, e->e_rdwr.lt_writer_writing, 0);
 
        /* delete from parent's id2children entry */
        if( (pdn = dn_parent( be, e->e_ndn )) != NULL ) {
                if( (p = dn2entry_w( be, pdn, &matched )) == NULL) {
-                       Debug( LDAP_DEBUG_TRACE, "parent does not exist\n",
+                       Debug( LDAP_DEBUG_TRACE,
+                               "<=- ldbm_back_delete: parent does not exist\n",
                                0, 0, 0);
                        send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
                                "", "");
@@ -84,7 +85,8 @@ ldbm_back_delete(
                if ( ! access_allowed( be, conn, op, p,
                        "children", NULL, ACL_WRITE ) )
                {
-                       Debug( LDAP_DEBUG_TRACE, "no access to parent\n", 0,
+                       Debug( LDAP_DEBUG_TRACE,
+                               "<=- ldbm_back_delete: no access to parent\n", 0,
                                0, 0 );
                        send_ldap_result( conn, op, LDAP_INSUFFICIENT_ACCESS,
                                "", "" );
@@ -95,14 +97,15 @@ ldbm_back_delete(
        } else {
                /* no parent, must be root to delete */
                if( ! be_isroot( be, op->o_ndn ) ) {
-                       Debug( LDAP_DEBUG_TRACE, "no parent & not root\n",
+                       Debug( LDAP_DEBUG_TRACE,
+                               "<=- ldbm_back_delete: no parent & not root\n",
                                0, 0, 0);
                        send_ldap_result( conn, op, LDAP_INSUFFICIENT_ACCESS,
                                "", "");
                        goto return_results;
                }
 
-               pthread_mutex_lock(&li->li_root_mutex);
+               ldap_pvt_thread_mutex_lock(&li->li_root_mutex);
                rootlock = 1;
        }
 
@@ -145,7 +148,7 @@ return_results:;
 
        if ( rootlock ) {
                /* release root lock */
-               pthread_mutex_unlock(&li->li_root_mutex);
+               ldap_pvt_thread_mutex_unlock(&li->li_root_mutex);
        }
 
        /* free entry and writer lock */
index e42c1f0e511e8d704204c4f71b8fef202f98c8a3..2aee65d523b745b0279badce13f31ab2acb01ba3 100644 (file)
@@ -33,7 +33,7 @@ id2entry_add( Backend *be, Entry *e )
        key.dptr = (char *) &e->e_id;
        key.dsize = sizeof(ID);
 
-       pthread_mutex_lock( &entry2str_mutex );
+       ldap_pvt_thread_mutex_lock( &entry2str_mutex );
        data.dptr = entry2str( e, &len, 1 );
        data.dsize = len + 1;
 
@@ -42,7 +42,7 @@ id2entry_add( Backend *be, Entry *e )
        if ( li->li_dbcachewsync ) flags |= LDBM_SYNC;
        rc = ldbm_cache_store( db, key, data, flags );
 
-       pthread_mutex_unlock( &entry2str_mutex );
+       ldap_pvt_thread_mutex_unlock( &entry2str_mutex );
 
        ldbm_cache_close( be, db );
        (void) cache_add_entry_lock( &li->li_cache, e, 0 );
@@ -66,7 +66,7 @@ id2entry_delete( Backend *be, Entry *e )
 
        /* XXX - check for writer lock - should also check no reader pending */
 #ifdef LDAP_DEBUG
-       assert(pthread_rdwr_wchk_np(&e->e_rdwr));
+       assert(ldap_pvt_thread_rdwr_wchk(&e->e_rdwr));
 #endif
 
        ldbm_datum_init( key );
@@ -74,7 +74,7 @@ id2entry_delete( Backend *be, Entry *e )
        /* XXX - check for writer lock - should also check no reader pending */
        Debug (LDAP_DEBUG_TRACE,
                "rdwr_Xchk: readers_reading: %d writer_writing: %d\n",
-               e->e_rdwr.readers_reading, e->e_rdwr.writer_writing, 0);
+               e->e_rdwr.lt_readers_reading, e->e_rdwr.lt_writer_writing, 0);
  
        if ( (db = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, LDBM_WRCREAT ))
                == NULL ) {
index 016be0644108895c329d9001321a243dd5240821..2d858e133a9425dde1d4cb69e167f0e214b5d875 100644 (file)
@@ -203,7 +203,7 @@ add_value(
        }
        idl_free( idl );
 
-       pthread_yield();
+       ldap_pvt_thread_yield();
 
        /* Debug( LDAP_DEBUG_TRACE, "<= add_value %d\n", rc, 0, 0 ); */
        return( rc );
index 501e451880f9914f62ef92fc86088852e206a1a4..f0ae9fb7779f7f3879b44defdefaf28041b32418 100644 (file)
@@ -70,12 +70,12 @@ ldbm_back_init(
        free( argv[ 1 ] );
 
        /* initialize various mutex locks & condition variables */
-       pthread_mutex_init( &li->li_root_mutex, pthread_mutexattr_default );
-       pthread_mutex_init( &li->li_add_mutex, pthread_mutexattr_default );
-       pthread_mutex_init( &li->li_cache.c_mutex, pthread_mutexattr_default );
-       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 );
+       ldap_pvt_thread_mutex_init( &li->li_root_mutex );
+       ldap_pvt_thread_mutex_init( &li->li_add_mutex );
+       ldap_pvt_thread_mutex_init( &li->li_cache.c_mutex );
+       ldap_pvt_thread_mutex_init( &li->li_nextid_mutex );
+       ldap_pvt_thread_mutex_init( &li->li_dbcache_mutex );
+       ldap_pvt_thread_cond_init( &li->li_dbcache_cv );
 
        be->be_private = li;
 }
index 96e3f9422aa910fc3a1ac41de69dd7705f36f38e..1ef124d5544cd6f8d4208ae648b0db144c0cf4b5 100644 (file)
@@ -77,12 +77,12 @@ ldbm_back_modify(
        }
 
        /* check for abandon */
-       pthread_mutex_lock( &op->o_abandonmutex );
+       ldap_pvt_thread_mutex_lock( &op->o_abandonmutex );
        if ( op->o_abandon ) {
-               pthread_mutex_unlock( &op->o_abandonmutex );
+               ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
                goto error_return;
        }
-       pthread_mutex_unlock( &op->o_abandonmutex );
+       ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
 
        /* modify indexes */
        if ( index_add_mods( be, mods, e->e_id ) != 0 ) {
@@ -91,12 +91,12 @@ ldbm_back_modify(
        }
 
        /* check for abandon */
-       pthread_mutex_lock( &op->o_abandonmutex );
+       ldap_pvt_thread_mutex_lock( &op->o_abandonmutex );
        if ( op->o_abandon ) {
-               pthread_mutex_unlock( &op->o_abandonmutex );
+               ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
                goto error_return;
        }
-       pthread_mutex_unlock( &op->o_abandonmutex );
+       ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
 
        /* change the entry itself */
        if ( id2entry_add( be, e ) != 0 ) {
index 33f6536bdc7b01be884e021d8e92fcfb396d56ee..cf2e9751aac28e1ed90fa5e699fc177c09bd33d4 100644 (file)
@@ -107,7 +107,7 @@ ldbm_back_modrdn(
                        goto return_results;
                }
 
-               pthread_mutex_lock(&li->li_root_mutex);
+               ldap_pvt_thread_mutex_lock(&li->li_root_mutex);
                rootlock = 1;
 
                new_dn = ch_strdup( newrdn );
@@ -121,12 +121,12 @@ ldbm_back_modrdn(
        }
 
        /* check for abandon */
-       pthread_mutex_lock( &op->o_abandonmutex );
+       ldap_pvt_thread_mutex_lock( &op->o_abandonmutex );
        if ( op->o_abandon ) {
-               pthread_mutex_unlock( &op->o_abandonmutex );
+               ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
                goto return_results;
        }
-       pthread_mutex_unlock( &op->o_abandonmutex );
+       ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
 
        /* add new one */
        if ( dn2id_add( be, new_ndn, e->e_id ) != 0 ) {
@@ -180,7 +180,7 @@ return_results:
 
        if ( rootlock ) {
                /* release root writer lock */
-               pthread_mutex_unlock(&li->li_root_mutex);
+               ldap_pvt_thread_mutex_unlock(&li->li_root_mutex);
        }
 
        /* free entry and writer lock */
index e29d86b6ca4e9cb9930d361ade9f27ab19390280..25841ca86d9fdef58247e9c85c8095ef987619c7 100644 (file)
@@ -102,7 +102,7 @@ next_id( Backend *be )
        struct ldbminfo *li = (struct ldbminfo *) be->be_private;
        ID              id;
 
-       pthread_mutex_lock( &li->li_nextid_mutex );
+       ldap_pvt_thread_mutex_lock( &li->li_nextid_mutex );
 
        /* first time in here since startup - try to read the nexid */
        if ( li->li_nextid == NOID ) {
@@ -128,7 +128,7 @@ next_id( Backend *be )
        (void) next_id_write( be, li->li_nextid );
 #endif
 
-       pthread_mutex_unlock( &li->li_nextid_mutex );
+       ldap_pvt_thread_mutex_unlock( &li->li_nextid_mutex );
        return( id );
 }
 
@@ -138,10 +138,10 @@ next_id_return( Backend *be, ID id )
 #ifdef SLAPD_NEXTID_RETURN
        struct ldbminfo *li = (struct ldbminfo *) be->be_private;
 
-       pthread_mutex_lock( &li->li_nextid_mutex );
+       ldap_pvt_thread_mutex_lock( &li->li_nextid_mutex );
 
        if ( id != li->li_nextid - 1 ) {
-               pthread_mutex_unlock( &li->li_nextid_mutex );
+               ldap_pvt_thread_mutex_unlock( &li->li_nextid_mutex );
                return;
        }
 
@@ -151,7 +151,7 @@ next_id_return( Backend *be, ID id )
        (void) next_id_write( be, li->li_nextid );
 #endif
 
-       pthread_mutex_unlock( &li->li_nextid_mutex );
+       ldap_pvt_thread_mutex_unlock( &li->li_nextid_mutex );
 #endif
 }
 
@@ -161,7 +161,7 @@ next_id_get( Backend *be )
        struct ldbminfo *li = (struct ldbminfo *) be->be_private;
        ID              id;
 
-       pthread_mutex_lock( &li->li_nextid_mutex );
+       ldap_pvt_thread_mutex_lock( &li->li_nextid_mutex );
 
        /* first time in here since startup - try to read the nexid */
        if ( li->li_nextid == NOID ) {
@@ -178,7 +178,7 @@ next_id_get( Backend *be )
 
        id = li->li_nextid;
 
-       pthread_mutex_unlock( &li->li_nextid_mutex );
+       ldap_pvt_thread_mutex_unlock( &li->li_nextid_mutex );
 
        return( id );
 }
index 6b6d62adab70818bb93c8f00d9a8408fa2e0121a..4fb6c6a17a70d757ea93e5af324837fea491e9ac 100644 (file)
@@ -144,9 +144,9 @@ ldbm_back_search(
        for ( id = idl_firstid( candidates ); id != NOID;
            id = idl_nextid( candidates, id ) ) {
                /* check for abandon */
-               pthread_mutex_lock( &op->o_abandonmutex );
+               ldap_pvt_thread_mutex_lock( &op->o_abandonmutex );
                if ( op->o_abandon ) {
-                       pthread_mutex_unlock( &op->o_abandonmutex );
+                       ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
                        idl_free( candidates );
                        free( rbuf );
                        if( realBase != NULL) {
@@ -154,13 +154,13 @@ ldbm_back_search(
                        }
                        return( 0 );
                }
-               pthread_mutex_unlock( &op->o_abandonmutex );
+               ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
 
                /* check time limit */
-               pthread_mutex_lock( &currenttime_mutex );
+               ldap_pvt_thread_mutex_lock( &currenttime_mutex );
                time( &currenttime );
                if ( tlimit != -1 && currenttime > stoptime ) {
-                       pthread_mutex_unlock( &currenttime_mutex );
+                       ldap_pvt_thread_mutex_unlock( &currenttime_mutex );
                        send_ldap_search_result( conn, op,
                            LDAP_TIMELIMIT_EXCEEDED, NULL, nrefs > 0 ? rbuf :
                            NULL, nentries );
@@ -171,7 +171,7 @@ ldbm_back_search(
                        }
                        return( 0 );
                }
-               pthread_mutex_unlock( &currenttime_mutex );
+               ldap_pvt_thread_mutex_unlock( &currenttime_mutex );
 
                /* get the entry with reader lock */
                if ( (e = id2entry_r( be, id )) == NULL ) {
@@ -292,7 +292,7 @@ ldbm_back_search(
                        cache_return_entry_r( &li->li_cache, e );
                }
 
-               pthread_yield();
+               ldap_pvt_thread_yield();
        }
        idl_free( candidates );
        if ( nrefs > 0 ) {
index cbfc68fb4d663fe7e44eacc72eed34b4bd234270..8695ffa616fc138714c10ba488723f5f95d99d05 100644 (file)
@@ -72,25 +72,25 @@ passwd_back_search(
 
        for ( pw = getpwent(); pw != NULL; pw = getpwent() ) {
                /* check for abandon */
-               pthread_mutex_lock( &op->o_abandonmutex );
+               ldap_pvt_thread_mutex_lock( &op->o_abandonmutex );
                if ( op->o_abandon ) {
-                       pthread_mutex_unlock( &op->o_abandonmutex );
+                       ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
                        endpwent();
                        return( -1 );
                }
-               pthread_mutex_unlock( &op->o_abandonmutex );
+               ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
 
                /* check time limit */
-               pthread_mutex_lock( &currenttime_mutex );
+               ldap_pvt_thread_mutex_lock( &currenttime_mutex );
                time( &currenttime );
                if ( currenttime > stoptime ) {
-                       pthread_mutex_unlock( &currenttime_mutex );
+                       ldap_pvt_thread_mutex_unlock( &currenttime_mutex );
                        send_ldap_result( conn, op, LDAP_TIMELIMIT_EXCEEDED,
                            NULL, NULL );
                        endpwent();
                        return( 0 );
                }
-               pthread_mutex_unlock( &currenttime_mutex );
+               ldap_pvt_thread_mutex_unlock( &currenttime_mutex );
 
                e = pw2entry( be, pw );
 
index fc9d6a40b6162512a9c620e67aef97f72a87c083..fbb799dc981fb65d610c67db56eea4a7011aeb5a 100644 (file)
@@ -1,10 +1,13 @@
 /* abandon.c - shell backend abandon function */
 
+#include "portable.h"
+
 #include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
 #include <signal.h>
+
+#include <ac/socket.h>
+#include <ac/string.h>
+
 #include "slap.h"
 #include "shell.h"
 
@@ -23,7 +26,7 @@ shell_back_abandon(
 
        /* no abandon command defined - just kill the process handling it */
        if ( si->si_abandon == NULL ) {
-               pthread_mutex_lock( &conn->c_opsmutex );
+               ldap_pvt_thread_mutex_lock( &conn->c_opsmutex );
                pid = -1;
                for ( o = conn->c_ops; o != NULL; o = o->o_next ) {
                        if ( o->o_msgid == msgid ) {
@@ -31,7 +34,7 @@ shell_back_abandon(
                                break;
                        }
                }
-               pthread_mutex_unlock( &conn->c_opsmutex );
+               ldap_pvt_thread_mutex_unlock( &conn->c_opsmutex );
 
                if ( pid != -1 ) {
                        Debug( LDAP_DEBUG_ARGS, "shell killing pid %d\n", pid,
index 5d201fd586f8afbc555d102ce5a0a82a05206aca..ec718618125a013ca1d1261314346644d93acf5c 100644 (file)
@@ -38,9 +38,9 @@ shell_back_add(
        fprintf( wfp, "ADD\n" );
        fprintf( wfp, "msgid: %ld\n", op->o_msgid );
        print_suffixes( wfp, be );
-       pthread_mutex_lock( &entry2str_mutex );
+       ldap_pvt_thread_mutex_lock( &entry2str_mutex );
        fprintf( wfp, "%s", entry2str( e, &len, 0 ) );
-       pthread_mutex_unlock( &entry2str_mutex );
+       ldap_pvt_thread_mutex_unlock( &entry2str_mutex );
        fclose( wfp );
 
        /* read in the result and send it along */
index f50a6e1c7b639809ae391835da3060dc6a4a460f..3593be516892709314aabc483d24ffedb3920188 100644 (file)
@@ -231,13 +231,13 @@ be_isroot_pw( Backend *be, char *ndn, struct berval *cred )
        }
 
 #ifdef SLAPD_CRYPT
-       pthread_mutex_lock( &crypt_mutex );
+       ldap_pvt_thread_mutex_lock( &crypt_mutex );
 #endif
 
        result = lutil_passwd( cred->bv_val, be->be_root_pw );
 
 #ifdef SLAPD_CRYPT
-       pthread_mutex_unlock( &crypt_mutex );
+       ldap_pvt_thread_mutex_unlock( &crypt_mutex );
 #endif
 
        return result == 0;
index 4ba1471d5bfb90cf57e8527e612a784659467fb2..678a54932f3f0f0d60acdc2854243f2daf7b777f 100644 (file)
@@ -135,7 +135,7 @@ do_bind(
                        free( cred.bv_val );
                }
 
-               pthread_mutex_lock( &conn->c_dnmutex );
+               ldap_pvt_thread_mutex_lock( &conn->c_dnmutex );
 
                if ( conn->c_cdn != NULL ) {
                        free( conn->c_cdn );
@@ -147,7 +147,7 @@ do_bind(
                        conn->c_dn = NULL;
                }
 
-               pthread_mutex_unlock( &conn->c_dnmutex );
+               ldap_pvt_thread_mutex_unlock( &conn->c_dnmutex );
 
                send_ldap_result( conn, op, LDAP_SUCCESS, NULL, NULL );
                return;
@@ -166,7 +166,7 @@ do_bind(
                        free( cred.bv_val );
                }
                if ( cred.bv_len == 0 ) {
-                       pthread_mutex_lock( &conn->c_dnmutex );
+                       ldap_pvt_thread_mutex_lock( &conn->c_dnmutex );
 
                        if ( conn->c_cdn != NULL ) {
                                free( conn->c_cdn );
@@ -178,7 +178,7 @@ do_bind(
                                conn->c_dn = NULL;
                        }
 
-                       pthread_mutex_unlock( &conn->c_dnmutex );
+                       ldap_pvt_thread_mutex_unlock( &conn->c_dnmutex );
 
                        send_ldap_result( conn, op, LDAP_SUCCESS,
                                NULL, NULL );
@@ -199,7 +199,7 @@ do_bind(
                ndn = suffixAlias( ndn, op, be );
 
                if ( (*be->be_bind)( be, conn, op, ndn, method, &cred, &edn ) == 0 ) {
-                       pthread_mutex_lock( &conn->c_dnmutex );
+                       ldap_pvt_thread_mutex_lock( &conn->c_dnmutex );
 
                        if ( conn->c_cdn != NULL ) {
                                free( conn->c_cdn );
@@ -222,7 +222,7 @@ do_bind(
                        Debug( LDAP_DEBUG_TRACE, "do_bind: bound \"%s\" to \"%s\"\n",
                        conn->c_cdn, conn->c_dn, method );
 
-                       pthread_mutex_unlock( &conn->c_dnmutex );
+                       ldap_pvt_thread_mutex_unlock( &conn->c_dnmutex );
 
                        /* send this here to avoid a race condition */
                        send_ldap_result( conn, op, LDAP_SUCCESS, NULL, NULL );
index e3974e4ac05662ee3758b78cefdc1d40e7ff2e20..fe4a474eb82a92a6479c4567622f39599f2402cb 100644 (file)
@@ -129,14 +129,14 @@ str2charray( char *str, char *brkstr )
        res = (char **) ch_malloc( (i + 1) * sizeof(char *) );
        i = 0;
 
-       pthread_mutex_lock(&strtok_mutex);
+       ldap_pvt_thread_mutex_lock(&strtok_mutex);
 
        for ( s = strtok( str, brkstr ); s != NULL; s = strtok( NULL,
            brkstr ) ) {
                res[i++] = ch_strdup( s );
        }
 
-       pthread_mutex_unlock(&strtok_mutex);
+       ldap_pvt_thread_mutex_unlock(&strtok_mutex);
 
        res[i] = NULL;
 
index 159f01ef0f96f1300719209493b40b8e4fe60a88..563d33bd50576ea695e7337252f6cc9f212c548f 100644 (file)
@@ -27,13 +27,13 @@ connection_operation( void *arg_v )
        struct co_arg   *arg = arg_v;
        unsigned long   len;
 
-       pthread_mutex_lock( &arg->co_conn->c_opsmutex );
+       ldap_pvt_thread_mutex_lock( &arg->co_conn->c_opsmutex );
        arg->co_conn->c_opsinitiated++;
-       pthread_mutex_unlock( &arg->co_conn->c_opsmutex );
+       ldap_pvt_thread_mutex_unlock( &arg->co_conn->c_opsmutex );
 
-       pthread_mutex_lock( &ops_mutex );
+       ldap_pvt_thread_mutex_lock( &ops_mutex );
        ops_initiated++;
-       pthread_mutex_unlock( &ops_mutex );
+       ldap_pvt_thread_mutex_unlock( &ops_mutex );
 
        switch ( arg->co_op->o_tag ) {
        case LDAP_REQ_BIND:
@@ -87,23 +87,23 @@ connection_operation( void *arg_v )
                break;
        }
 
-       pthread_mutex_lock( &arg->co_conn->c_opsmutex );
+       ldap_pvt_thread_mutex_lock( &arg->co_conn->c_opsmutex );
        arg->co_conn->c_opscompleted++;
        slap_op_delete( &arg->co_conn->c_ops, arg->co_op );
-       pthread_mutex_unlock( &arg->co_conn->c_opsmutex );
+       ldap_pvt_thread_mutex_unlock( &arg->co_conn->c_opsmutex );
 
        free( (char *) arg );
 
-       pthread_mutex_lock( &ops_mutex );
+       ldap_pvt_thread_mutex_lock( &ops_mutex );
        ops_completed++;
-       pthread_mutex_unlock( &ops_mutex );
+       ldap_pvt_thread_mutex_unlock( &ops_mutex );
 
-       pthread_mutex_lock( &active_threads_mutex );
+       ldap_pvt_thread_mutex_lock( &active_threads_mutex );
        active_threads--;
        if( active_threads < 1 ) {
-               pthread_cond_signal(&active_threads_cond);
+               ldap_pvt_thread_cond_signal(&active_threads_cond);
        }
-       pthread_mutex_unlock( &active_threads_mutex );
+       ldap_pvt_thread_mutex_unlock( &active_threads_mutex );
        return NULL;
 }
 
@@ -112,9 +112,6 @@ connection_activity(
     Connection *conn
 )
 {
-#ifndef HAVE_PTHREAD_DETACH
-       pthread_attr_t  attr;
-#endif
        int status;
        struct co_arg   *arg;
        unsigned long   tag, len;
@@ -181,68 +178,29 @@ connection_activity(
        arg = (struct co_arg *) ch_malloc( sizeof(struct co_arg) );
        arg->co_conn = conn;
 
-       pthread_mutex_lock( &conn->c_dnmutex );
+       ldap_pvt_thread_mutex_lock( &conn->c_dnmutex );
        if ( conn->c_dn != NULL ) {
                tmpdn = ch_strdup( conn->c_dn );
        } else {
                tmpdn = NULL;
        }
-       pthread_mutex_unlock( &conn->c_dnmutex );
+       ldap_pvt_thread_mutex_unlock( &conn->c_dnmutex );
 
-       pthread_mutex_lock( &conn->c_opsmutex );
+       ldap_pvt_thread_mutex_lock( &conn->c_opsmutex );
        arg->co_op = slap_op_add( &conn->c_ops, ber, msgid, tag, tmpdn,
            conn->c_opsinitiated, conn->c_connid );
-       pthread_mutex_unlock( &conn->c_opsmutex );
+       ldap_pvt_thread_mutex_unlock( &conn->c_opsmutex );
 
        if ( tmpdn != NULL ) {
                free( tmpdn );
        }
 
-#ifdef HAVE_PTHREAD_DETACH
-       if ( status = pthread_create( &arg->co_op->o_tid, NULL,
-           connection_operation, (void *) arg ) != 0 ) {
-               Debug( LDAP_DEBUG_ANY, "pthread_create failed (%d)\n", status, 0, 0 );
-       } else {
-               pthread_mutex_lock( &active_threads_mutex );
-               active_threads++;
-               pthread_mutex_unlock( &active_threads_mutex );
-       }
-
-#if !defined(HAVE_PTHREADS_D4)
-       pthread_detach( arg->co_op->o_tid );
-#else
-       pthread_detach( &arg->co_op->o_tid );
-#endif
-
-#else /* !pthread detach */
-
-       pthread_attr_init( &attr );
-       pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED );
-#if !defined(HAVE_PTHREADS_D4)
-       /* POSIX_THREADS or compatible
-        * This is a draft 10 or standard pthreads implementation
-        */
-       if ( status = pthread_create( &arg->co_op->o_tid, &attr,
+       if ( status = ldap_pvt_thread_create( &arg->co_op->o_tid, 1,
            connection_operation, (void *) arg ) != 0 ) {
-               Debug( LDAP_DEBUG_ANY, "pthread_create failed (%d)\n", status, 0, 0 );
+               Debug( LDAP_DEBUG_ANY, "ldap_pvt_thread_create failed (%d)\n", status, 0, 0 );
        } else {
-               pthread_mutex_lock( &active_threads_mutex );
+               ldap_pvt_thread_mutex_lock( &active_threads_mutex );
                active_threads++;
-               pthread_mutex_unlock( &active_threads_mutex );
+               ldap_pvt_thread_mutex_unlock( &active_threads_mutex );
        }
-#else  /* pthread draft4  */
-       /*
-        * This is a draft 4 or earlier pthreads implementation
-        */
-       if ( status = pthread_create( &arg->co_op->o_tid, attr,
-           connection_operation, (void *) arg ) != 0 ) {
-               Debug( LDAP_DEBUG_ANY, "pthread_create failed (%d)\n", status, 0, 0 );
-       } else {
-               pthread_mutex_lock( &active_threads_mutex );
-               active_threads++;
-               pthread_mutex_unlock( &active_threads_mutex );
-       }
-#endif /* pthread draft4 */
-       pthread_attr_destroy( &attr );
-#endif
 }
index e016fb30351354a567d70d5e2a709aee59a69b9b..e5217c821756f5bed18da9554a8dbabcec61b599 100644 (file)
@@ -90,13 +90,10 @@ slapd_daemon(
                c[i].c_sb.sb_ber.ber_end = NULL;
                c[i].c_writewaiter = 0;
                c[i].c_connid = 0;
-               pthread_mutex_init( &c[i].c_dnmutex,
-                   pthread_mutexattr_default );
-               pthread_mutex_init( &c[i].c_opsmutex,
-                   pthread_mutexattr_default );
-               pthread_mutex_init( &c[i].c_pdumutex,
-                   pthread_mutexattr_default );
-               pthread_cond_init( &c[i].c_wcv, pthread_condattr_default );
+               ldap_pvt_thread_mutex_init( &c[i].c_dnmutex );
+               ldap_pvt_thread_mutex_init( &c[i].c_opsmutex );
+               ldap_pvt_thread_mutex_init( &c[i].c_pdumutex );
+               ldap_pvt_thread_cond_init( &c[i].c_wcv );
        }
 
        if ( (tcps = socket( AF_INET, SOCK_STREAM, 0 )) == -1 ) {
@@ -173,12 +170,12 @@ slapd_daemon(
                zero.tv_sec = 0;
                zero.tv_usec = 0;
 
-               pthread_mutex_lock( &active_threads_mutex );
+               ldap_pvt_thread_mutex_lock( &active_threads_mutex );
                Debug( LDAP_DEBUG_CONNS,
                    "listening for connections on %d, activity on:",
                    tcps, 0, 0 );
 
-               pthread_mutex_lock( &new_conn_mutex );
+               ldap_pvt_thread_mutex_lock( &new_conn_mutex );
                for ( i = 0; i < dtblsize; i++ ) {
                        if ( c[i].c_sb.sb_sd != -1 ) {
                                FD_SET( c[i].c_sb.sb_sd, &readfds );
@@ -191,7 +188,7 @@ slapd_daemon(
                        }
                }
                Debug( LDAP_DEBUG_CONNS, "\n", 0, 0, 0 );
-               pthread_mutex_unlock( &new_conn_mutex );
+               ldap_pvt_thread_mutex_unlock( &new_conn_mutex );
 
                Debug( LDAP_DEBUG_CONNS, "before select active_threads %d\n",
                    active_threads, 0, 0 );
@@ -200,7 +197,7 @@ slapd_daemon(
 #else
                tvp = active_threads ? &zero : NULL;
 #endif
-               pthread_mutex_unlock( &active_threads_mutex );
+               ldap_pvt_thread_mutex_unlock( &active_threads_mutex );
 
                switch ( i = select( dtblsize, &readfds, &writefds, 0, tvp ) ) {
                case -1:        /* failure - try again */
@@ -213,19 +210,19 @@ slapd_daemon(
                case 0:         /* timeout - let threads run */
                        Debug( LDAP_DEBUG_CONNS, "select timeout - yielding\n",
                            0, 0, 0 );
-                       pthread_yield();
+                       ldap_pvt_thread_yield();
                        continue;
 
                default:        /* something happened - deal with it */
                        Debug( LDAP_DEBUG_CONNS, "select activity on %d descriptors\n", i, 0, 0 );
                        ;       /* FALL */
                }
-               pthread_mutex_lock( &currenttime_mutex );
+               ldap_pvt_thread_mutex_lock( &currenttime_mutex );
                time( &currenttime );
-               pthread_mutex_unlock( &currenttime_mutex );
+               ldap_pvt_thread_mutex_unlock( &currenttime_mutex );
 
                /* new connection */
-               pthread_mutex_lock( &new_conn_mutex );
+               ldap_pvt_thread_mutex_lock( &new_conn_mutex );
                if ( FD_ISSET( tcps, &readfds ) ) {
                        len = sizeof(from);
                        if ( (ns = accept( tcps, (struct sockaddr *) &from,
@@ -234,7 +231,7 @@ slapd_daemon(
                                    "accept() failed errno %d (%s)", errno,
                                    errno > -1 && errno < sys_nerr ?
                                    sys_errlist[errno] : "unknown", 0 );
-                               pthread_mutex_unlock( &new_conn_mutex );
+                               ldap_pvt_thread_mutex_unlock( &new_conn_mutex );
                                continue;
                        }
                        if ( ioctl( ns, FIONBIO, (caddr_t) &on ) == -1 ) {
@@ -292,15 +289,15 @@ slapd_daemon(
                                  0, 0 );
 
                                close(ns);
-                               pthread_mutex_unlock( &new_conn_mutex );
+                               ldap_pvt_thread_mutex_unlock( &new_conn_mutex );
                                continue;
                        }
 #endif /* HAVE_TCPD */
 
                        c[ns].c_sb.sb_sd = ns;
-                       pthread_mutex_lock( &ops_mutex );
+                       ldap_pvt_thread_mutex_lock( &ops_mutex );
                        c[ns].c_connid = num_conns++;
-                       pthread_mutex_unlock( &ops_mutex );
+                       ldap_pvt_thread_mutex_unlock( &ops_mutex );
 
                        Statslog( LDAP_DEBUG_STATS,
                            "conn=%d fd=%d connection from %s (%s) accepted.\n",
@@ -321,7 +318,7 @@ slapd_daemon(
                        c[ns].c_domain = ch_strdup( client_name == NULL
                                ? "" : client_name );
 
-                       pthread_mutex_lock( &c[ns].c_dnmutex );
+                       ldap_pvt_thread_mutex_lock( &c[ns].c_dnmutex );
                        if ( c[ns].c_dn != NULL ) {
                                free( c[ns].c_dn );
                                c[ns].c_dn = NULL;
@@ -330,12 +327,12 @@ slapd_daemon(
                                free( c[ns].c_cdn );
                                c[ns].c_cdn = NULL;
                        }
-                       pthread_mutex_unlock( &c[ns].c_dnmutex );
+                       ldap_pvt_thread_mutex_unlock( &c[ns].c_dnmutex );
                        c[ns].c_starttime = currenttime;
                        c[ns].c_opsinitiated = 0;
                        c[ns].c_opscompleted = 0;
                }
-               pthread_mutex_unlock( &new_conn_mutex );
+               ldap_pvt_thread_mutex_unlock( &new_conn_mutex );
 
                Debug( LDAP_DEBUG_CONNS, "activity on:", 0, 0, 0 );
                for ( i = 0; i < dtblsize; i++ ) {
@@ -360,11 +357,11 @@ slapd_daemon(
                                Debug( LDAP_DEBUG_CONNS,
                                    "signaling write waiter on %d\n", i, 0, 0 );
 
-                               pthread_mutex_lock( &active_threads_mutex );
-                               pthread_cond_signal( &c[i].c_wcv );
+                               ldap_pvt_thread_mutex_lock( &active_threads_mutex );
+                               ldap_pvt_thread_cond_signal( &c[i].c_wcv );
                                c[i].c_writewaiter = 0;
                                active_threads++;
-                               pthread_mutex_unlock( &active_threads_mutex );
+                               ldap_pvt_thread_mutex_unlock( &active_threads_mutex );
                        }
 
                        if ( FD_ISSET( i, &readfds ) ) {
@@ -375,19 +372,19 @@ slapd_daemon(
                        }
                }
 
-               pthread_yield();
+               ldap_pvt_thread_yield();
        }
 
        close( tcps );
 
-       pthread_mutex_lock( &active_threads_mutex );
+       ldap_pvt_thread_mutex_lock( &active_threads_mutex );
        Debug( LDAP_DEBUG_ANY,
            "slapd shutting down - waiting for %d threads to terminate\n",
            active_threads, 0, 0 );
        while ( active_threads > 0 ) {
-               pthread_cond_wait(&active_threads_cond, &active_threads_mutex);
+               ldap_pvt_thread_cond_wait(&active_threads_cond, &active_threads_mutex);
        }
-       pthread_mutex_unlock( &active_threads_mutex );
+       ldap_pvt_thread_mutex_unlock( &active_threads_mutex );
 
        /* let backends do whatever cleanup they need to do */
        Debug( LDAP_DEBUG_TRACE,
@@ -403,7 +400,7 @@ set_shutdown( int sig )
 {
        Debug( LDAP_DEBUG_ANY, "slapd got shutdown signal %d\n", sig, 0, 0 );
        slapd_shutdown = 1;
-       pthread_kill( listener_tid, LDAP_SIGUSR1 );
+       ldap_pvt_thread_kill( listener_tid, LDAP_SIGUSR1 );
        (void) SIGNAL( LDAP_SIGUSR2, set_shutdown );
        (void) SIGNAL( SIGTERM, set_shutdown );
        (void) SIGNAL( SIGINT, set_shutdown );
index b5f25d70d80d3ca4accdadf0d651c40fd0b2956e..c8a9c2a924bd75485b1e28535ef0f771ff6dfcd0 100644 (file)
@@ -220,8 +220,8 @@ entry_free( Entry *e )
 
        /* XXX check that no reader/writer locks exist */
 #ifdef LDAP_DEBUG
-       assert( !pthread_rdwr_wchk_np(&e->e_rdwr) &&
-               !pthread_rdwr_rchk_np(&e->e_rdwr) );
+       assert( !ldap_pvt_thread_rdwr_wchk(&e->e_rdwr) &&
+               !ldap_pvt_thread_rdwr_rchk(&e->e_rdwr) );
 #endif
 
        if ( e->e_dn != NULL ) {
@@ -243,9 +243,9 @@ entry_rdwr_lock(Entry *e, int rw)
        Debug( LDAP_DEBUG_ARGS, "entry_rdwr_%slock: ID: %ld\n",
                rw ? "w" : "r", e->e_id, 0);
        if (rw)
-               return pthread_rdwr_wlock_np(&e->e_rdwr);
+               return ldap_pvt_thread_rdwr_wlock(&e->e_rdwr);
        else
-               return pthread_rdwr_rlock_np(&e->e_rdwr);
+               return ldap_pvt_thread_rdwr_rlock(&e->e_rdwr);
 }
 
 int
@@ -266,9 +266,9 @@ entry_rdwr_unlock(Entry *e, int rw)
        Debug( LDAP_DEBUG_ARGS, "entry_rdwr_%sunlock: ID: %ld\n",
                rw ? "w" : "r", e->e_id, 0);
        if (rw)
-               return pthread_rdwr_wunlock_np(&e->e_rdwr);
+               return ldap_pvt_thread_rdwr_wunlock(&e->e_rdwr);
        else
-               return pthread_rdwr_runlock_np(&e->e_rdwr);
+               return ldap_pvt_thread_rdwr_runlock(&e->e_rdwr);
 }
 
 int
@@ -286,5 +286,5 @@ entry_rdwr_wunlock(Entry *e)
 int
 entry_rdwr_init(Entry *e)
 {
-       return pthread_rdwr_init_np(&e->e_rdwr, NULL);
+       return ldap_pvt_thread_rdwr_init( &e->e_rdwr );
 }
index 527fe165076e6af080d0ee8b5cccf517a9db7677..c536f9c64697f73ac681779ee8364fc8ce5c192e 100644 (file)
@@ -26,7 +26,7 @@ int           ldap_syslog;
 int            ldap_syslog_level = LOG_DEBUG;
 char           *default_referral;
 time_t         starttime;
-pthread_t      listener_tid;
+ldap_pvt_thread_t      listener_tid;
 int            g_argc;
 char           **g_argv;
 
@@ -34,48 +34,50 @@ char                **g_argv;
  * global variables that need mutex protection
  */
 int                            active_threads;
-pthread_mutex_t        active_threads_mutex;
-pthread_cond_t active_threads_cond;
+ldap_pvt_thread_mutex_t        active_threads_mutex;
+ldap_pvt_thread_cond_t active_threads_cond;
 
 time_t                 currenttime;
-pthread_mutex_t        currenttime_mutex;
+ldap_pvt_thread_mutex_t        currenttime_mutex;
 
-pthread_mutex_t        new_conn_mutex;
+ldap_pvt_thread_mutex_t        new_conn_mutex;
 
 #ifdef SLAPD_CRYPT
-pthread_mutex_t        crypt_mutex;
+ldap_pvt_thread_mutex_t        crypt_mutex;
 #endif
-pthread_mutex_t        strtok_mutex;
+ldap_pvt_thread_mutex_t        strtok_mutex;
 
 int                            num_conns;
 long                   ops_initiated;
 long                   ops_completed;
-pthread_mutex_t        ops_mutex;
+ldap_pvt_thread_mutex_t        ops_mutex;
 
 long                   num_entries_sent;
 long                   num_bytes_sent;
-pthread_mutex_t        num_sent_mutex;
+ldap_pvt_thread_mutex_t        num_sent_mutex;
 /*
  * these mutexes must be used when calling the entry2str()
  * routine since it returns a pointer to static data.
  */
-pthread_mutex_t        entry2str_mutex;
-pthread_mutex_t        replog_mutex;
+ldap_pvt_thread_mutex_t        entry2str_mutex;
+ldap_pvt_thread_mutex_t        replog_mutex;
 
 void
 init( void )
 {
-       pthread_mutex_init( &active_threads_mutex, pthread_mutexattr_default );
-       pthread_cond_init( &active_threads_cond, pthread_condattr_default );
-
-       pthread_mutex_init( &new_conn_mutex, pthread_mutexattr_default );
-       pthread_mutex_init( &currenttime_mutex, pthread_mutexattr_default );
-       pthread_mutex_init( &strtok_mutex, pthread_mutexattr_default );
-       pthread_mutex_init( &entry2str_mutex, pthread_mutexattr_default );
-       pthread_mutex_init( &replog_mutex, pthread_mutexattr_default );
-       pthread_mutex_init( &ops_mutex, pthread_mutexattr_default );
-       pthread_mutex_init( &num_sent_mutex, pthread_mutexattr_default );
+       (void) ldap_pvt_thread_initialize();
+
+       ldap_pvt_thread_mutex_init( &active_threads_mutex );
+       ldap_pvt_thread_cond_init( &active_threads_cond );
+
+       ldap_pvt_thread_mutex_init( &new_conn_mutex );
+       ldap_pvt_thread_mutex_init( &currenttime_mutex );
+       ldap_pvt_thread_mutex_init( &entry2str_mutex );
+       ldap_pvt_thread_mutex_init( &replog_mutex );
+       ldap_pvt_thread_mutex_init( &ops_mutex );
+       ldap_pvt_thread_mutex_init( &num_sent_mutex );
 #ifdef SLAPD_CRYPT
-       pthread_mutex_init( &crypt_mutex, pthread_mutexattr_default );
+       ldap_pvt_thread_mutex_init( &crypt_mutex );
 #endif
+       ldap_pvt_thread_mutex_init( &strtok_mutex );
 }
index 565688643cb1c68aa5eda0d2a4296ffc39323c47..c0c474e4bf1a8f2fd3cbae2c308201c38a976719 100644 (file)
@@ -191,18 +191,15 @@ main( int argc, char **argv )
 
                time( &starttime );
 
-               if ( pthread_create( &listener_tid, NULL, slapd_daemon,
-                   (void *) port ) != 0 ) {
+               if ( status = ldap_pvt_thread_create( &listener_tid, 0,
+                       slapd_daemon, (void *) port ) != 0 )
+               {
                        Debug( LDAP_DEBUG_ANY,
-                           "listener pthread_create failed\n", 0, 0, 0 );
+                           "listener ldap_pvt_thread_create failed (%d)\n", status, 0, 0 );
                        exit( 1 );
                }
 
-#ifdef HAVE_PTHREADS_FINAL
-               pthread_join( listener_tid, (void *) NULL );
-#else
-               pthread_join( listener_tid, (void *) &status );
-#endif
+               ldap_pvt_thread_join( listener_tid, (void *) NULL );
 
                return 0;
 
@@ -225,9 +222,9 @@ main( int argc, char **argv )
                c.c_sb.sb_ber.ber_buf = NULL;
                c.c_sb.sb_ber.ber_ptr = NULL;
                c.c_sb.sb_ber.ber_end = NULL;
-               pthread_mutex_init( &c.c_dnmutex, pthread_mutexattr_default );
-               pthread_mutex_init( &c.c_opsmutex, pthread_mutexattr_default );
-               pthread_mutex_init( &c.c_pdumutex, pthread_mutexattr_default );
+               ldap_pvt_thread_mutex_init( &c.c_dnmutex );
+               ldap_pvt_thread_mutex_init( &c.c_opsmutex );
+               ldap_pvt_thread_mutex_init( &c.c_pdumutex );
 #ifdef notdefcldap
                c.c_sb.sb_addrs = (void **) saddrlist;
                c.c_sb.sb_fromaddr = &faddr;
@@ -256,9 +253,9 @@ main( int argc, char **argv )
                ber_init( &ber, 0 );
                while ( (tag = ber_get_next( &c.c_sb, &len, &ber ))
                    == LDAP_TAG_MESSAGE ) {
-                       pthread_mutex_lock( &currenttime_mutex );
+                       ldap_pvt_thread_mutex_lock( &currenttime_mutex );
                        time( &currenttime );
-                       pthread_mutex_unlock( &currenttime_mutex );
+                       ldap_pvt_thread_mutex_unlock( &currenttime_mutex );
 
                        if ( (tag = ber_get_int( &ber, &msgid ))
                            != LDAP_TAG_MSGID ) {
index 01e75b2f06aa4962ddb6d48c148d2bfc0834d156..c1ddd3faf40f03548c8b532cbdc80550f265be77 100644 (file)
@@ -245,7 +245,7 @@ add_lastmods( Operation *op, LDAPMod **mods )
        tmp->mod_next = *mods;
        *mods = tmp;
 
-       pthread_mutex_lock( &currenttime_mutex );
+       ldap_pvt_thread_mutex_lock( &currenttime_mutex );
 #ifndef LDAP_LOCALTIME
        ltm = gmtime( &currenttime );
        strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm );
@@ -253,7 +253,7 @@ add_lastmods( Operation *op, LDAPMod **mods )
        ltm = localtime( &currenttime );
        strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm );
 #endif
-       pthread_mutex_unlock( &currenttime_mutex );
+       ldap_pvt_thread_mutex_unlock( &currenttime_mutex );
        bv.bv_val = buf;
        bv.bv_len = strlen( bv.bv_val );
        tmp = (LDAPMod *) ch_calloc( 1, sizeof(LDAPMod) );
index f9514fd519a5d2f89dce06597a026296edbdc29f..df9c788fbb908b8dad09af4905713546667b6479 100644 (file)
@@ -68,7 +68,7 @@ monitor_info( Connection *conn, Operation *op )
        nwritewaiters = 0;
        nreadwaiters = 0;
 
-       pthread_mutex_lock( &new_conn_mutex );
+       ldap_pvt_thread_mutex_lock( &new_conn_mutex );
        for ( i = 0; i < dtblsize; i++ ) {
                if ( c[i].c_sb.sb_sd != -1 ) {
                        nconns++;
@@ -78,7 +78,7 @@ monitor_info( Connection *conn, Operation *op )
                        if ( c[i].c_gettingber ) {
                                nreadwaiters++;
                        }
-                       pthread_mutex_lock( &currenttime_mutex );
+                       ldap_pvt_thread_mutex_lock( &currenttime_mutex );
 #ifndef LDAP_LOCALTIME
                        ltm = gmtime( &c[i].c_starttime );
                        strftime( buf2, sizeof(buf2), "%Y%m%d%H%M%SZ", ltm );
@@ -86,21 +86,21 @@ monitor_info( Connection *conn, Operation *op )
                        ltm = localtime( &c[i].c_starttime );
                        strftime( buf2, sizeof(buf2), "%y%m%d%H%M%SZ", ltm );
 #endif
-                       pthread_mutex_unlock( &currenttime_mutex );
+                       ldap_pvt_thread_mutex_unlock( &currenttime_mutex );
 
-                       pthread_mutex_lock( &c[i].c_dnmutex );
+                       ldap_pvt_thread_mutex_lock( &c[i].c_dnmutex );
                        sprintf( buf, "%d : %s : %d : %d : %s : %s%s", i,
                            buf2, c[i].c_opsinitiated, c[i].c_opscompleted,
                            c[i].c_cdn ? c[i].c_cdn : "NULLDN",
                            c[i].c_gettingber ? "r" : "",
                            c[i].c_writewaiter ? "w" : "" );
-                       pthread_mutex_unlock( &c[i].c_dnmutex );
+                       ldap_pvt_thread_mutex_unlock( &c[i].c_dnmutex );
                        val.bv_val = buf;
                        val.bv_len = strlen( buf );
                        attr_merge( e, "connection", vals );
                }
        }
-       pthread_mutex_unlock( &new_conn_mutex );
+       ldap_pvt_thread_mutex_unlock( &new_conn_mutex );
 
        sprintf( buf, "%d", nconns );
        val.bv_val = buf;
@@ -147,7 +147,7 @@ monitor_info( Connection *conn, Operation *op )
        val.bv_len = strlen( buf );
        attr_merge( e, "bytessent", vals );
 
-       pthread_mutex_lock( &currenttime_mutex );
+       ldap_pvt_thread_mutex_lock( &currenttime_mutex );
 #ifndef LDAP_LOCALTIME
        ltm = gmtime( &currenttime );
        strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm );
@@ -155,12 +155,12 @@ monitor_info( Connection *conn, Operation *op )
        ltm = localtime( &currenttime );
        strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm );
 #endif
-       pthread_mutex_unlock( &currenttime_mutex );
+       ldap_pvt_thread_mutex_unlock( &currenttime_mutex );
        val.bv_val = buf;
        val.bv_len = strlen( buf );
        attr_merge( e, "currenttime", vals );
 
-       pthread_mutex_lock( &currenttime_mutex );
+       ldap_pvt_thread_mutex_lock( &currenttime_mutex );
 #ifndef LDAP_LOCALTIME
        ltm = gmtime( &starttime );
        strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm );
@@ -168,7 +168,7 @@ monitor_info( Connection *conn, Operation *op )
        ltm = localtime( &starttime );
        strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm );
 #endif
-       pthread_mutex_unlock( &currenttime_mutex );
+       ldap_pvt_thread_mutex_unlock( &currenttime_mutex );
        val.bv_val = buf;
        val.bv_len = strlen( buf );
        attr_merge( e, "starttime", vals );
@@ -178,8 +178,8 @@ monitor_info( Connection *conn, Operation *op )
        val.bv_len = strlen( buf );
        attr_merge( e, "nbackends", vals );
 
-#ifdef HAVE_THR
-       sprintf( buf, "%d", thr_getconcurrency() );
+#ifdef HAVE_THREAD_CONCURRENCY
+       sprintf( buf, "%d", ldap_pvt_thread_getconcurrency() );
        val.bv_val = buf;
        val.bv_len = strlen( buf );
        attr_merge( e, "concurrency", vals );
index 56085eeb736cc60b7f8048b17a1517192681475d..6428c30214950e2178782431921bb329dbfd229d 100644 (file)
@@ -21,7 +21,7 @@ slap_op_free( Operation *op )
        if ( op->o_ndn != NULL ) {
                free( op->o_ndn );
        }
-       /* pthread_mutex_destroy( &op->o_abandonmutex ); */
+       ldap_pvt_thread_mutex_destroy( &op->o_abandonmutex );
        free( (char *) op );
 }
 
@@ -42,8 +42,7 @@ slap_op_add(
                ;       /* NULL */
 
        *tmp = (Operation *) calloc( 1, sizeof(Operation) );
-       pthread_mutex_init( &(*tmp)->o_abandonmutex,
-           pthread_mutexattr_default );
+       ldap_pvt_thread_mutex_init( &(*tmp)->o_abandonmutex );
        (*tmp)->o_ber = ber;
        (*tmp)->o_msgid = msgid;
        (*tmp)->o_tag = tag;
@@ -52,9 +51,9 @@ slap_op_add(
        (*tmp)->o_dn = ch_strdup( dn != NULL ? dn : "" );
        (*tmp)->o_ndn = dn_normalize_case( ch_strdup( (*tmp)->o_dn ) );
 
-       pthread_mutex_lock( &currenttime_mutex );
+       ldap_pvt_thread_mutex_lock( &currenttime_mutex );
        (*tmp)->o_time = currenttime;
-       pthread_mutex_unlock( &currenttime_mutex );
+       ldap_pvt_thread_mutex_unlock( &currenttime_mutex );
        (*tmp)->o_opid = id;
        (*tmp)->o_connid = connid;
        (*tmp)->o_next = NULL;
index aaa7b42a371dc21d0a0254ae23a0b02de4228d71..03f00e2f70885d0c1597bf762059d731622d2568 100644 (file)
@@ -245,20 +245,21 @@ extern long               num_entries_sent;
 extern long            ops_completed;
 extern long            ops_initiated;
 
-extern pthread_mutex_t active_threads_mutex;
-extern pthread_cond_t  active_threads_cond;
-
-extern pthread_mutex_t currenttime_mutex;
-extern pthread_mutex_t strtok_mutex;
-extern pthread_mutex_t entry2str_mutex;
-extern pthread_mutex_t new_conn_mutex;
-extern pthread_mutex_t num_sent_mutex;
-extern pthread_mutex_t ops_mutex;
-extern pthread_mutex_t replog_mutex;
+extern ldap_pvt_thread_mutex_t active_threads_mutex;
+extern ldap_pvt_thread_cond_t  active_threads_cond;
+
+extern ldap_pvt_thread_mutex_t currenttime_mutex;
+extern ldap_pvt_thread_mutex_t entry2str_mutex;
+extern ldap_pvt_thread_mutex_t new_conn_mutex;
+extern ldap_pvt_thread_mutex_t num_sent_mutex;
+extern ldap_pvt_thread_mutex_t ops_mutex;
+extern ldap_pvt_thread_mutex_t replog_mutex;
 #ifdef SLAPD_CRYPT
-extern pthread_mutex_t crypt_mutex;
+extern ldap_pvt_thread_mutex_t crypt_mutex;
 #endif
-extern pthread_t       listener_tid;
+extern ldap_pvt_thread_mutex_t strtok_mutex;
+
+extern ldap_pvt_thread_t       listener_tid;
 extern struct acl      *global_acl;
 extern struct objclass *global_oc;
 extern time_t          currenttime;
index ecea75af7a0f5619ed5fc0ac1bda1be8b67fbf05..e8fddf337bbbecbf6b35d29170a06d70a0260cdc 100644 (file)
@@ -33,10 +33,10 @@ replog(
                return;
        }
 
-       pthread_mutex_lock( &replog_mutex );
+       ldap_pvt_thread_mutex_lock( &replog_mutex );
        if ( (fp = lock_fopen( be->be_replogfile ? be->be_replogfile :
            replogfile, "a", &lfp )) == NULL ) {
-               pthread_mutex_unlock( &replog_mutex );
+               ldap_pvt_thread_mutex_unlock( &replog_mutex );
                return;
        }
 
@@ -92,7 +92,7 @@ replog(
        case LDAP_REQ_ADD:
                e = change;
                fprintf( fp, "changetype: add\n" );
-               pthread_mutex_lock( &entry2str_mutex );
+               ldap_pvt_thread_mutex_lock( &entry2str_mutex );
                tmp = entry2str( e, &len, 0 );
                while ( (tmp = strchr( tmp, '\n' )) != NULL ) {
                        tmp++;
@@ -100,7 +100,7 @@ replog(
                                break;
                }
                fprintf( fp, "%s", tmp );
-               pthread_mutex_unlock( &entry2str_mutex );
+               ldap_pvt_thread_mutex_unlock( &entry2str_mutex );
                break;
 
        case LDAP_REQ_DELETE:
@@ -116,5 +116,5 @@ replog(
        fprintf( fp, "\n" );
 
        lock_fclose( fp, lfp );
-       pthread_mutex_unlock( &replog_mutex );
+       ldap_pvt_thread_mutex_unlock( &replog_mutex );
 }
index 12e90a805b2e8f514934538d2b80bfabf330a1bd..15a28162f3ccf9d7ebc90855b8aa1625e9cb4d82 100644 (file)
@@ -83,14 +83,14 @@ send_ldap_result2(
        }
 
        /* write only one pdu at a time - wait til it's our turn */
-       pthread_mutex_lock( &conn->c_pdumutex );
+       ldap_pvt_thread_mutex_lock( &conn->c_pdumutex );
 
        /* write the pdu */
        bytes = ber->ber_ptr - ber->ber_buf;
-       pthread_mutex_lock( &new_conn_mutex );
+       ldap_pvt_thread_mutex_lock( &new_conn_mutex );
        while ( conn->c_connid == op->o_connid && ber_flush( &conn->c_sb, ber,
            1 ) != 0 ) {
-               pthread_mutex_unlock( &new_conn_mutex );
+               ldap_pvt_thread_mutex_unlock( &new_conn_mutex );
                /*
                 * we got an error.  if it's ewouldblock, we need to
                 * wait on the socket being writable.  otherwise, figure
@@ -104,33 +104,33 @@ send_ldap_result2(
                if ( errno != EWOULDBLOCK && errno != EAGAIN ) {
                        close_connection( conn, op->o_connid, op->o_opid );
 
-                       pthread_mutex_unlock( &conn->c_pdumutex );
+                       ldap_pvt_thread_mutex_unlock( &conn->c_pdumutex );
                        return;
                }
 
                /* wait for socket to be write-ready */
-               pthread_mutex_lock( &active_threads_mutex );
+               ldap_pvt_thread_mutex_lock( &active_threads_mutex );
                active_threads--;
                conn->c_writewaiter = 1;
 
-               pthread_kill( listener_tid, LDAP_SIGUSR1 );
+               ldap_pvt_thread_kill( listener_tid, LDAP_SIGUSR1 );
 
-               pthread_cond_wait( &conn->c_wcv, &active_threads_mutex );
+               ldap_pvt_thread_cond_wait( &conn->c_wcv, &active_threads_mutex );
 
                if( active_threads < 1 ) {
-                       pthread_cond_signal(&active_threads_cond);
+                       ldap_pvt_thread_cond_signal(&active_threads_cond);
                }
-               pthread_mutex_unlock( &active_threads_mutex );
+               ldap_pvt_thread_mutex_unlock( &active_threads_mutex );
 
-               pthread_yield();
-               pthread_mutex_lock( &new_conn_mutex );
+               ldap_pvt_thread_yield();
+               ldap_pvt_thread_mutex_lock( &new_conn_mutex );
        }
-       pthread_mutex_unlock( &new_conn_mutex );
-       pthread_mutex_unlock( &conn->c_pdumutex );
+       ldap_pvt_thread_mutex_unlock( &new_conn_mutex );
+       ldap_pvt_thread_mutex_unlock( &conn->c_pdumutex );
 
-       pthread_mutex_lock( &num_sent_mutex );
+       ldap_pvt_thread_mutex_lock( &num_sent_mutex );
        num_bytes_sent += bytes;
-       pthread_mutex_unlock( &num_sent_mutex );
+       ldap_pvt_thread_mutex_unlock( &num_sent_mutex );
 
        Statslog( LDAP_DEBUG_STATS,
            "conn=%d op=%d RESULT err=%d tag=%d nentries=%d\n", conn->c_connid,
@@ -319,13 +319,13 @@ send_search_entry(
        }
 
        /* write only one pdu at a time - wait til it's our turn */
-       pthread_mutex_lock( &conn->c_pdumutex );
+       ldap_pvt_thread_mutex_lock( &conn->c_pdumutex );
 
        bytes = ber->ber_ptr - ber->ber_buf;
-       pthread_mutex_lock( &new_conn_mutex );
+       ldap_pvt_thread_mutex_lock( &new_conn_mutex );
        while ( conn->c_connid == op->o_connid && ber_flush( &conn->c_sb, ber,
            1 ) != 0 ) {
-               pthread_mutex_unlock( &new_conn_mutex );
+               ldap_pvt_thread_mutex_unlock( &new_conn_mutex );
                /*
                 * we got an error.  if it's ewouldblock, we need to
                 * wait on the socket being writable.  otherwise, figure
@@ -339,34 +339,34 @@ send_search_entry(
                if ( errno != EWOULDBLOCK && errno != EAGAIN ) {
                        close_connection( conn, op->o_connid, op->o_opid );
 
-                       pthread_mutex_unlock( &conn->c_pdumutex );
+                       ldap_pvt_thread_mutex_unlock( &conn->c_pdumutex );
                        return( -1 );
                }
 
                /* wait for socket to be write-ready */
-               pthread_mutex_lock( &active_threads_mutex );
+               ldap_pvt_thread_mutex_lock( &active_threads_mutex );
                active_threads--;
                conn->c_writewaiter = 1;
-               pthread_kill( listener_tid, LDAP_SIGUSR1 );
-               pthread_cond_wait( &conn->c_wcv, &active_threads_mutex );
+               ldap_pvt_thread_kill( listener_tid, LDAP_SIGUSR1 );
+               ldap_pvt_thread_cond_wait( &conn->c_wcv, &active_threads_mutex );
 
                if( active_threads < 1 ) {
-                       pthread_cond_signal(&active_threads_cond);
+                       ldap_pvt_thread_cond_signal(&active_threads_cond);
                }
-               pthread_mutex_unlock( &active_threads_mutex );
+               ldap_pvt_thread_mutex_unlock( &active_threads_mutex );
 
-               pthread_yield();
-               pthread_mutex_lock( &new_conn_mutex );
+               ldap_pvt_thread_yield();
+               ldap_pvt_thread_mutex_lock( &new_conn_mutex );
        }
-       pthread_mutex_unlock( &new_conn_mutex );
-       pthread_mutex_unlock( &conn->c_pdumutex );
+       ldap_pvt_thread_mutex_unlock( &new_conn_mutex );
+       ldap_pvt_thread_mutex_unlock( &conn->c_pdumutex );
 
-       pthread_mutex_lock( &num_sent_mutex );
+       ldap_pvt_thread_mutex_lock( &num_sent_mutex );
        num_bytes_sent += bytes;
        num_entries_sent++;
-       pthread_mutex_unlock( &num_sent_mutex );
+       ldap_pvt_thread_mutex_unlock( &num_sent_mutex );
 
-       pthread_mutex_lock( &new_conn_mutex );
+       ldap_pvt_thread_mutex_lock( &new_conn_mutex );
        if ( conn->c_connid == op->o_connid ) {
                rc = 0;
                Statslog( LDAP_DEBUG_STATS2, "conn=%d op=%d ENTRY dn=\"%s\"\n",
@@ -374,7 +374,7 @@ send_search_entry(
        } else {
                rc = -1;
        }
-       pthread_mutex_unlock( &new_conn_mutex );
+       ldap_pvt_thread_mutex_unlock( &new_conn_mutex );
 
        Debug( LDAP_DEBUG_TRACE, "<= send_search_entry\n", 0, 0, 0 );
 
@@ -447,7 +447,7 @@ str2result(
 void
 close_connection( Connection *conn, int opconnid, int opid )
 {
-       pthread_mutex_lock( &new_conn_mutex );
+       ldap_pvt_thread_mutex_lock( &new_conn_mutex );
        if ( conn->c_sb.sb_sd != -1 && conn->c_connid == opconnid ) {
                Statslog( LDAP_DEBUG_STATS,
                    "conn=%d op=%d fd=%d closed errno=%d\n", conn->c_connid,
@@ -456,5 +456,5 @@ close_connection( Connection *conn, int opconnid, int opid )
                conn->c_sb.sb_sd = -1;
                conn->c_version = 0;
        }
-       pthread_mutex_unlock( &new_conn_mutex );
+       ldap_pvt_thread_mutex_unlock( &new_conn_mutex );
 }
index 9a883c0b682c8f567f6ee41fab016784ca4c974d..085e30a507f1b490b834b3bb2dfda28ff2e7defd 100644 (file)
@@ -19,8 +19,9 @@
 #include "avl.h"
 #include "lber.h"
 #include "ldap.h"
-#include "lthread.h"
-#include "lthread_rdwr.h"
+
+#include "ldap_pvt_thread.h"
+
 #include "ldif.h"
 #ifdef f_next
 #undef f_next /* name conflict between sys/file.h on SCO and struct filter */
@@ -132,7 +133,7 @@ typedef struct entry {
                                        /* really be private to back-ldbm */
        char            e_state;        /* for the cache                  */
 
-       pthread_rdwr_t  e_rdwr; /* reader/writer lock             */
+       ldap_pvt_thread_rdwr_t  e_rdwr; /* reader/writer lock             */
 
 #define ENTRY_STATE_DELETED    1
 #define ENTRY_STATE_CREATING   2
@@ -281,9 +282,9 @@ typedef struct slap_op {
        char            o_searchbase;   /* search base if via CLDAP       */
 #endif
        struct slap_op  *o_next;        /* next operation pending         */
-       pthread_t       o_tid;          /* thread handling this op        */
+       ldap_pvt_thread_t       o_tid;          /* thread handling this op        */
        int             o_abandon;      /* signals op has been abandoned  */
-       pthread_mutex_t o_abandonmutex; /* signals op has been abandoned  */
+       ldap_pvt_thread_mutex_t o_abandonmutex; /* signals op has been abandoned  */
 
        int             o_private;      /* anything the backend needs     */
 } Operation;
@@ -296,7 +297,7 @@ typedef struct slap_conn {
        Sockbuf         c_sb;           /* ber connection stuff           */
        char            *c_cdn;         /* DN provided by the client */
        char            *c_dn;          /* DN bound to this conn  */
-       pthread_mutex_t c_dnmutex;      /* mutex for c_dn field           */
+       ldap_pvt_thread_mutex_t c_dnmutex;      /* mutex for c_dn field           */
        int             c_authtype;     /* auth method used to bind c_dn  */
 #ifdef LDAP_COMPAT
        int             c_version;      /* for compatibility w/2.0, 3.0   */
@@ -304,9 +305,9 @@ typedef struct slap_conn {
        char            *c_addr;        /* address of client on this conn */
        char            *c_domain;      /* domain of client on this conn  */
        Operation       *c_ops;         /* list of pending operations     */
-       pthread_mutex_t c_opsmutex;     /* mutex for c_ops list & stats   */
-       pthread_mutex_t c_pdumutex;     /* only one pdu written at a time */
-       pthread_cond_t  c_wcv;          /* used to wait for sd write-ready*/
+       ldap_pvt_thread_mutex_t c_opsmutex;     /* mutex for c_ops list & stats   */
+       ldap_pvt_thread_mutex_t c_pdumutex;     /* only one pdu written at a time */
+       ldap_pvt_thread_cond_t  c_wcv;          /* used to wait for sd write-ready*/
        int             c_gettingber;   /* in the middle of ber_get_next  */
        BerElement      *c_currentber;  /* ber we're getting              */
        int             c_writewaiter;  /* signals write-ready sd waiter  */
index 335ff224d6374e2105c69bb14015045d0e62e1d8..ed25cf1a0f7c18264ae9d3e32b54c4e7c5bd8745 100644 (file)
@@ -9,12 +9,10 @@ XSRCS = version.c
 
 SRCS   =       admin.c args.c ch_malloc.c config.c \
                fm.c globals.c ldap_op.c lock.c main.c re.c \
-               reject.c replica.c replog.c ri.c rq.c sanity.c st.c \
-               tsleep.c
+               reject.c replica.c replog.c ri.c rq.c sanity.c st.c
 OBJS   =       admin.o args.o ch_malloc.o config.o \
                fm.o globals.o ldap_op.o lock.o main.o re.o \
-               reject.o replica.o replog.o ri.o rq.o sanity.o st.o \
-               tsleep.o
+               reject.o replica.o replog.o ri.o rq.o sanity.o st.o
 
 LDAP_INCDIR= ../../include       
 LDAP_LIBDIR= ../../libraries
index 5063927180dac1cb1eb9dfafa47abc22a4071e46..e63002f8269abc7c245e0781582e25de1c2f3e0e 100644 (file)
@@ -99,7 +99,7 @@ fm(
                }
            }
        } else {
-           tsleep( sglob->no_work_interval );
+           ldap_pvt_thread_sleep( sglob->no_work_interval );
        }
 
        /* Garbage-collect queue */
@@ -135,9 +135,9 @@ set_shutdown(int x)
     int        i;
 
     sglob->slurpd_shutdown = 1;                                /* set flag */
-    pthread_kill( sglob->fm_tid, LDAP_SIGUSR1 );       /* wake up file mgr */
+    ldap_pvt_thread_kill( sglob->fm_tid, LDAP_SIGUSR1 );       /* wake up file mgr */
     sglob->rq->rq_lock( sglob->rq );                   /* lock queue */
-    pthread_cond_broadcast( &(sglob->rq->rq_more) );   /* wake repl threads */
+    ldap_pvt_thread_cond_broadcast( &(sglob->rq->rq_more) );   /* wake repl threads */
     for ( i = 0; i < sglob->num_replicas; i++ ) {
        (sglob->replicas[ i ])->ri_wake( sglob->replicas[ i ]);
     }
@@ -203,7 +203,7 @@ populate_queue(
                    p, 0, 0 );
        }
        free( p );
-       pthread_yield();
+       ldap_pvt_thread_yield();
     }
     sglob->srpos = ftell( fp );
     }
index 91b7e3086fcc6b90f3364dea62b1b4238b526e0d..fed3bbf31dcc605ff75fb3c86834e4952f82ef18 100644 (file)
@@ -60,7 +60,7 @@ init_globals( void )
        fprintf( stderr, "Cannot initialize status data\n" );
        exit( 1 );
     }
-    pthread_mutex_init( &(g->rej_mutex), pthread_mutexattr_default );
+    ldap_pvt_thread_mutex_init( &(g->rej_mutex) );
     if ( Rq_init( &(g->rq)) < 0 ) {
        fprintf( stderr, "Cannot initialize queue\n" );
        exit( 1 );
index 211c829ecd7da815ae0f13bd6d5c24851dd3807f..74d82e41e8b69d207c71c738111924435f8f14ed 100644 (file)
@@ -23,7 +23,7 @@ LDAP_BEGIN_DECL
 
 typedef struct globals {
     /* Thread ID for file manager thread */
-    pthread_t fm_tid;
+    ldap_pvt_thread_t fm_tid;
     /* The name of the slapd config file (which is also our config file) */
     char *slapd_configfile;
     /* How long the master slurpd sleeps when there's no work to do */
@@ -49,7 +49,7 @@ typedef struct globals {
     /* Current offset into slurpd replica logfile */
     off_t srpos;
     /* mutex to serialize access to reject file */
-    pthread_mutex_t rej_mutex;
+    ldap_pvt_thread_mutex_t rej_mutex;
     /* pointer to status struct */
     St *st;
     /* Pointer to replication queue */
index 5469454cc715030377e933ce3b578d1e28911f3d..cc094ba44670b69580276b5c9b7d410153777dfc 100644 (file)
@@ -36,7 +36,6 @@ main(
     return( 1 );
 #else
 
-    pthread_attr_t     attr;
     int                        status;
     int                        i;
 
@@ -94,13 +93,8 @@ main(
 #endif /* LDAP_DEBUG */
        lutil_detach( 0, 0 );
 
-#if defined( HAVE_LWP )
-    /*
-     * Need to start a scheduler thread under SunOS 4
-     */
-    start_lwp_scheduler();
-#endif /* HAVE_LWP */
-
+       /* initialize thread package */
+       ldap_pvt_thread_initialize();
 
     /*
      * Start threads - one thread for each replica
@@ -112,9 +106,10 @@ main(
     /*
      * Start the main file manager thread (in fm.c).
      */
-    if ( pthread_create( &(sglob->fm_tid), NULL, fm, (void *) NULL )
-           != 0 ) {
-       Debug( LDAP_DEBUG_ANY, "file manager pthread_create failed\n",
+    if ( ldap_pvt_thread_create( &(sglob->fm_tid),
+               0, fm, (void *) NULL ) != 0 )
+       {
+       Debug( LDAP_DEBUG_ANY, "file manager ldap_pvt_thread_create failed\n",
                0, 0, 0 );
        exit( 1 );
 
@@ -123,20 +118,13 @@ main(
     /*
      * Wait for the fm thread to finish.
      */
-#ifdef HAVE_PTHREADS_FINAL
-    pthread_join( sglob->fm_tid, (void *) NULL );
-#else
-    pthread_join( sglob->fm_tid, (void *) &status );
-#endif
+    ldap_pvt_thread_join( sglob->fm_tid, (void *) NULL );
+
     /*
      * Wait for the replica threads to finish.
      */
     for ( i = 0; sglob->replicas[ i ] != NULL; i++ ) {
-#ifdef HAVE_PTHREADS_FINAL
-       pthread_join( sglob->replicas[ i ]->ri_tid, (void *) NULL );
-#else
-       pthread_join( sglob->replicas[ i ]->ri_tid, (void *) &status );
-#endif
+       ldap_pvt_thread_join( sglob->replicas[ i ]->ri_tid, (void *) NULL );
     }
     Debug( LDAP_DEBUG_ANY, "slurpd: terminating normally\n", 0, 0, 0 );
     sglob->slurpd_shutdown = 1;
index 5792850d7eda50bde168ead293cde90352deb902..e180a74c8aef81cb69005325af7de8777e5fbd74 100644 (file)
@@ -81,7 +81,7 @@ Re_free(
     }
 #if !defined( HAVE_LWP )
     /* This seems to have problems under SunOS lwp */
-    pthread_mutex_destroy( &re->re_mutex );
+    ldap_pvt_thread_mutex_destroy( &re->re_mutex );
 #endif /* HAVE_LWP */
     ch_free( re->re_timestamp );
     if (( rh = re->re_replicas ) != NULL ) {
@@ -641,7 +641,7 @@ Re_lock(
     Re *re
 )
 {
-    return( pthread_mutex_lock( &re->re_mutex ));
+    return( ldap_pvt_thread_mutex_lock( &re->re_mutex ));
 }
 
 
@@ -655,7 +655,7 @@ Re_unlock(
     Re *re
 )
 {
-    return( pthread_mutex_unlock( &re->re_mutex ));
+    return( ldap_pvt_thread_mutex_unlock( &re->re_mutex ));
 }
 
 
@@ -696,7 +696,7 @@ Re_init(
    (*re)->re_mods = NULL;
    (*re)->re_next = NULL;
 
-   pthread_mutex_init( &((*re)->re_mutex), pthread_mutexattr_default );
+   ldap_pvt_thread_mutex_init( &((*re)->re_mutex) );
    return 0;
 }
 
index 8ae0dc63635728ca298566a8cced943f1ff4d134..0d0e606a42ed0671c7147d3a0ac4c15a97f957ce 100644 (file)
  * to a replica LDAP server.
  */
 
+#include "portable.h"
 
 #include <stdio.h>
+
+#include <ac/errno.h>
+#include <ac/unistd.h>
+
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <unistd.h>
 
 #include "slurp.h"
 #include "globals.h"
 
-#ifndef SYSERRLIST_IN_STDIO
-extern char *sys_errlist[];
-#endif /* SYSERRLIST_IN_STDIO */
-
-
 /*
  * Write a replication record to a reject file.  The reject file has the
  * same name as the replica's private copy of the file but with ".rej"
@@ -52,7 +51,7 @@ write_reject(
     FILE       *rfp, *lfp;
     int                rc;
 
-    pthread_mutex_lock( &sglob->rej_mutex );
+    ldap_pvt_thread_mutex_lock( &sglob->rej_mutex );
     sprintf( rejfile, "%s/%s:%d.rej", sglob->slurpd_rdir,
            ri->ri_hostname, ri->ri_port );
 
@@ -64,7 +63,7 @@ write_reject(
            Debug( LDAP_DEBUG_ANY,
                "Error: write_reject: Cannot create \"%s\": %s\n",
                rejfile, sys_errlist[ errno ], 0 );
-           pthread_mutex_unlock( &sglob->rej_mutex );
+           ldap_pvt_thread_mutex_unlock( &sglob->rej_mutex );
            return;
        } else {
            close( rjfd );
@@ -90,7 +89,7 @@ write_reject(
                "Error: ldap operation failed, data written to \"%s\"\n",
                rejfile, 0, 0 );
     }
-    pthread_mutex_unlock( &sglob->rej_mutex );
+    ldap_pvt_thread_mutex_unlock( &sglob->rej_mutex );
     return;
 }
 
index 7ccd356a15f33150411684ae415237c8fc5643b5..8e919b274a887824f97465b44af7a278fa7246f9 100644 (file)
@@ -55,9 +55,9 @@ start_replica_thread(
 )
 {
     /* POSIX_THREADS or compatible */
-    if ( pthread_create( &(ri->ri_tid), NULL, replicate,
+    if ( ldap_pvt_thread_create( &(ri->ri_tid), NULL, replicate,
            (void *) ri ) != 0 ) {
-       Debug( LDAP_DEBUG_ANY, "replica \"%s:%d\" pthread_create failed\n",
+       Debug( LDAP_DEBUG_ANY, "replica \"%s:%d\" ldap_pvt_thread_create failed\n",
                ri->ri_hostname, ri->ri_port, 0 );
        return -1;
     }
index de335061ab7886e609f4e05de9fa26facded545d..857cc5d07fb91ceb8e309632a5eb935605f58e0c 100644 (file)
@@ -60,7 +60,7 @@ Ri_process(
     while ( !sglob->slurpd_shutdown &&
            (( re = rq->rq_gethead( rq )) == NULL )) {
        /* No work - wait on condition variable */
-       pthread_cond_wait( &rq->rq_more, &rq->rq_mutex );
+       ldap_pvt_thread_cond_wait( &rq->rq_more, &rq->rq_mutex );
     }
 
     /*
@@ -84,7 +84,7 @@ Ri_process(
                rc = do_ldap( ri, re, &errmsg );
                switch ( rc ) {
                case DO_LDAP_ERR_RETRYABLE:
-                   tsleep( RETRY_SLEEP_TIME );
+                   ldap_pvt_thread_sleep( RETRY_SLEEP_TIME );
                    Debug( LDAP_DEBUG_ANY,
                            "Retrying operation for DN %s on replica %s:%d\n",
                            re->re_dn, ri->ri_hostname, ri->ri_port );
@@ -118,7 +118,7 @@ Ri_process(
                return 0;
            }
            /* No work - wait on condition variable */
-           pthread_cond_wait( &rq->rq_more, &rq->rq_mutex );
+           ldap_pvt_thread_cond_wait( &rq->rq_more, &rq->rq_mutex );
        }
        re->re_decrefcnt( re );
        re = new_re;
@@ -143,7 +143,7 @@ Ri_wake(
     if ( ri == NULL ) {
        return;
     }
-    pthread_kill( ri->ri_tid, LDAP_SIGUSR1 );
+    ldap_pvt_thread_kill( ri->ri_tid, LDAP_SIGUSR1 );
     (void) SIGNAL( LDAP_SIGUSR1, do_nothing );
 }
 
index 3fe7285275e1dd5862b661314c61fddc8ef349ee..46667210b698ff8b6571d5b7d8c3e81e526847db 100644 (file)
@@ -49,7 +49,7 @@ Rq_lock(
     Rq *rq
 )
 {
-    return( pthread_mutex_lock( &rq->rq_mutex ));
+    return( ldap_pvt_thread_mutex_lock( &rq->rq_mutex ));
 }
 
 
@@ -61,7 +61,7 @@ Rq_unlock(
     Rq *rq
 )
 {
-    return( pthread_mutex_unlock( &rq->rq_mutex ));
+    return( ldap_pvt_thread_mutex_unlock( &rq->rq_mutex ));
 }
 
 
@@ -184,7 +184,7 @@ Rq_add(
     /* Increment count of items in queue */
     rq->rq_nre++;
     /* wake up any threads waiting for more work */
-    pthread_cond_broadcast( &rq->rq_more );
+    ldap_pvt_thread_cond_broadcast( &rq->rq_more );
 
     /* ... and unlock the queue */
     rq->rq_unlock( rq );
@@ -397,8 +397,8 @@ Rq_init(
     (*rq)->rq_getcount = Rq_getcount;
 
     /* Initialize private data */
-    pthread_mutex_init( &((*rq)->rq_mutex), pthread_mutexattr_default );
-    pthread_cond_init( &((*rq)->rq_more), pthread_condattr_default );
+    ldap_pvt_thread_mutex_init( &((*rq)->rq_mutex) );
+    ldap_pvt_thread_cond_init( &((*rq)->rq_more) );
     (*rq)->rq_head = NULL;
     (*rq)->rq_tail = NULL;
     (*rq)->rq_nre = 0;
index 8339a1e071d9e541925aff9ba5c2afca54866c14..28ae98a0845ad67d5f113e778ce16575667663c2 100644 (file)
 
 #include "lber.h"
 #include "ldap.h"
-#include "lthread.h"
+
+#include "ldap_pvt_thread.h"
 #include "ldapconfig.h"
 #include "ldif.h"
 
-
 /* Default directory for slurpd's private copy of replication logs */
 #define        DEFAULT_SLURPD_REPLICA_DIR      "/usr/tmp"
 
@@ -180,7 +180,7 @@ struct ri {
     struct stel        *ri_stel;               /* pointer to Stel for this replica */
     unsigned long
                ri_seq;                 /* seq number of last repl */
-    pthread_t  ri_tid;                 /* ID of thread for this replica */
+    ldap_pvt_thread_t  ri_tid;                 /* ID of thread for this replica */
 
     /* Member functions */
     int (*ri_process) LDAP_P(( Ri * ));        /* process the next repl entry */
@@ -214,7 +214,7 @@ typedef struct re Re;
 struct re {
 
     /* Private data */
-    pthread_mutex_t
+    ldap_pvt_thread_mutex_t
                re_mutex;               /* mutex for this Re */
     int                re_refcnt;              /* ref count, 0 = done */
     char       *re_timestamp;          /* timestamp of this re */
@@ -259,9 +259,9 @@ struct rq {
     time_t     rq_lasttrim;            /* Last time we trimmed file */
     
     /* Public data */
-    pthread_mutex_t
+    ldap_pvt_thread_mutex_t
                rq_mutex;               /* mutex for whole queue */
-    pthread_cond_t
+    ldap_pvt_thread_cond_t
                rq_more;                /* condition var - more work added */
 
     /* Member functions */
@@ -306,7 +306,7 @@ typedef struct stel {
 typedef struct st St;
 struct st {
     /* Private data */
-    pthread_mutex_t
+    ldap_pvt_thread_mutex_t
                st_mutex;               /* mutex to serialize access */
     Stel       **st_data;              /* array of pointers to Stel structs */
     int                st_nreplicas;           /* number of repl hosts */
index 3d50e80ce4c19fe6187bafdfc04ca95d29b1736a..fed678b88de87db306542436427afa048baf6f84 100644 (file)
@@ -43,19 +43,19 @@ St_add(
     }
 
     /* Serialize access to the St struct */
-    pthread_mutex_lock( &(st->st_mutex ));
+    ldap_pvt_thread_mutex_lock( &(st->st_mutex ));
 
     st->st_nreplicas++;
     ind = st->st_nreplicas - 1;
     st->st_data = ( Stel ** ) ch_realloc( st->st_data, 
            ( st->st_nreplicas * sizeof( Stel * )));
     if ( st->st_data == NULL ) {
-       pthread_mutex_unlock( &(st->st_mutex ));
+       ldap_pvt_thread_mutex_unlock( &(st->st_mutex ));
        return NULL;
     }
     st->st_data[ ind ]  = ( Stel * ) ch_malloc( sizeof( Stel ) );
     if ( st->st_data[ ind ] == NULL ) {
-       pthread_mutex_unlock( &(st->st_mutex ));
+       ldap_pvt_thread_mutex_unlock( &(st->st_mutex ));
        return NULL;
     }
 
@@ -64,7 +64,7 @@ St_add(
     memset( st->st_data[ ind ]->last, 0, sizeof( st->st_data[ ind ]->last )); 
     st->st_data[ ind ]->seq = 0;
 
-    pthread_mutex_unlock( &(st->st_mutex ));
+    ldap_pvt_thread_mutex_unlock( &(st->st_mutex ));
     return st->st_data[ ind ];
 }
 
@@ -85,7 +85,7 @@ St_write (
     if ( st == NULL ) {
        return -1;
     }
-    pthread_mutex_lock( &(st->st_mutex ));
+    ldap_pvt_thread_mutex_lock( &(st->st_mutex ));
     if ( st->st_fp == NULL ) {
        /* Open file */
        if (( rc = acquire_lock( sglob->slurpd_status_file, &(st->st_fp),
@@ -95,7 +95,7 @@ St_write (
                        "Error: cannot open status file \"%s\": %s\n",
                        sglob->slurpd_status_file, sys_errlist[ errno ], 0 );
                st->st_err_logged = 1;
-               pthread_mutex_unlock( &(st->st_mutex ));
+               ldap_pvt_thread_mutex_unlock( &(st->st_mutex ));
                return -1;
            }
        } else {
@@ -113,7 +113,7 @@ St_write (
     }
     fflush( st->st_fp );
 
-    pthread_mutex_unlock( &(st->st_mutex ));
+    ldap_pvt_thread_mutex_unlock( &(st->st_mutex ));
 
     return 0;
 }
@@ -135,10 +135,10 @@ St_update(
        return -1;
     }
 
-    pthread_mutex_lock( &(st->st_mutex ));
+    ldap_pvt_thread_mutex_lock( &(st->st_mutex ));
     strcpy( stel->last, re->re_timestamp );
     stel->seq = re->re_seq;
-    pthread_mutex_unlock( &(st->st_mutex ));
+    ldap_pvt_thread_mutex_unlock( &(st->st_mutex ));
     return 0;
 }
 
@@ -164,7 +164,7 @@ St_read(
     if ( st == NULL ) {
        return -1;
     }
-    pthread_mutex_lock( &(st->st_mutex ));
+    ldap_pvt_thread_mutex_lock( &(st->st_mutex ));
     if ( access( sglob->slurpd_status_file, F_OK ) < 0 ) {
        /*
         * File doesn't exist, so create it and return.
@@ -172,17 +172,17 @@ St_read(
        if (( fp = fopen( sglob->slurpd_status_file, "w" )) == NULL ) {
            Debug( LDAP_DEBUG_ANY, "Error: cannot create status file \"%s\"\n",
                    sglob->slurpd_status_file, 0, 0 );
-           pthread_mutex_unlock( &(st->st_mutex ));
+           ldap_pvt_thread_mutex_unlock( &(st->st_mutex ));
            return -1;
        }
        (void) fclose( fp );
-       pthread_mutex_unlock( &(st->st_mutex ));
+       ldap_pvt_thread_mutex_unlock( &(st->st_mutex ));
        Debug( LDAP_DEBUG_ARGS, "No status file found, defaulting values\n",
                0, 0, 0 );
        return 0;
     }
     if (( rc = acquire_lock( sglob->slurpd_status_file, &fp, &lfp)) < 0 ) {
-       pthread_mutex_unlock( &(st->st_mutex ));
+       ldap_pvt_thread_mutex_unlock( &(st->st_mutex ));
        return 0;
     }
     while ( fgets( buf, sizeof( buf ), fp ) != NULL ) {
@@ -232,12 +232,12 @@ St_read(
        }
     }
     (void) relinquish_lock( sglob->slurpd_status_file, fp, lfp);
-    pthread_mutex_unlock( &(st->st_mutex ));
+    ldap_pvt_thread_mutex_unlock( &(st->st_mutex ));
     return 0;
 
 bad:
     (void) relinquish_lock( sglob->slurpd_status_file, fp, lfp);
-    pthread_mutex_unlock( &(st->st_mutex ));
+    ldap_pvt_thread_mutex_unlock( &(st->st_mutex ));
     return -1;
 }
     
@@ -252,7 +252,7 @@ St_lock(
     St *st
 )
 {
-    return( pthread_mutex_lock( &st->st_mutex ));
+    return( ldap_pvt_thread_mutex_lock( &st->st_mutex ));
 }
 
 
@@ -266,7 +266,7 @@ St_unlock(
     St *st
 )
 {
-    return( pthread_mutex_unlock( &st->st_mutex ));
+    return( ldap_pvt_thread_mutex_unlock( &st->st_mutex ));
 }
 
 
@@ -289,7 +289,7 @@ St_init(
        return -1;
     }
 
-    pthread_mutex_init( &((*st)->st_mutex), pthread_mutexattr_default );
+    ldap_pvt_thread_mutex_init( &((*st)->st_mutex) );
     (*st)->st_data = NULL;
     (*st)->st_fp = NULL;
     (*st)->st_lfp = NULL;
diff --git a/servers/slurpd/tsleep.c b/servers/slurpd/tsleep.c
deleted file mode 100644 (file)
index c21cf7d..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (c) 1996 Regents of the University of Michigan.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that this notice is preserved and that due credit is given
- * to the University of Michigan at Ann Arbor. The name of the University
- * may not be used to endorse or promote products derived from this
- * software without specific prior written permission. This software
- * is provided ``as is'' without express or implied warranty.
- */
-
-/*
- * tsleep.c - allow a thread to sleep without putting the whole process
- * (e.g. pod under lwp) to sleep.  Contains platform-specific code to
- * allow this:
- *
- * Under non-preemptive threads packages like SunOS lwp, tsleep() adds
- * the thread to a list of sleepers.  The lwp_scheduler process takes
- * care of resuming suspended threads.
- *
- * Under a fully-preemptive threads package, like Solaris threads,
- * tsleep just calls sleep(), and there is no scheduler thread.  Life
- * is so much simpler...
- */
-
-#include "portable.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ac/unistd.h>         /* get sleep() */
-
-#include "slurp.h"
-#include "globals.h"
-
-
-#if defined( HAVE_LWP )
-
-int
-tsleep(
-    time_t     interval
-)
-{
-    thread_t   mylwp;
-    tl_t       *t, *nt;
-    time_t     now;
-
-
-    if ( lwp_self( &mylwp ) < 0 ) {
-       return -1;
-    }
-    time( &now );
-
-    mon_enter( &sglob->tsl_mon );
-    if ( sglob->tsl_list != NULL ) {
-       for ( t = sglob->tsl_list; t != NULL; t = t->tl_next ) {
-           if ( SAMETHREAD( t->tl_tid, mylwp )) {
-               /* We're already sleeping? */
-               t->tl_wake = now + interval;
-               mon_exit( &sglob->tsl_mon );
-               lwp_suspend( mylwp );
-               return 0;
-           }
-       }
-    }
-    nt = (tl_t *) malloc( sizeof( tl_t ));
-
-    nt->tl_next = sglob->tsl_list;
-    nt->tl_wake = now + interval;
-    nt->tl_tid = mylwp;
-    sglob->tsl_list = nt;
-    mon_exit( &sglob->tsl_mon );
-    lwp_suspend( mylwp );
-    return 0;
-}
-
-/*
- * The lwp_scheduler thread periodically checks to see if any threads
- * are due to be resumed.  If there are, it resumes them.  Otherwise,
- * it computes the lesser of ( 1 second ) or ( the minimum time until
- * a thread need to be resumed ) and puts itself to sleep for that amount
- * of time.
- */
-void
-lwp_scheduler(
-    int        stackno
-)
-{
-    time_t             now, min;
-    struct timeval     interval;
-    tl_t               *t;
-
-    while ( !sglob->slurpd_shutdown ) {
-       mon_enter( &sglob->tsl_mon );
-       time( &now );
-       min = 0L;
-       if ( sglob->tsl_list != NULL ) {
-           for ( t = sglob->tsl_list; t != NULL; t = t->tl_next ) {
-               if (( t->tl_wake  > 0L ) && ( t->tl_wake < now )) {
-                   lwp_resume( t->tl_tid );
-                   t->tl_wake = 0L;
-               }
-               if (( t->tl_wake > now ) && ( t->tl_wake < min )) {
-                   min =  t->tl_wake;
-               }
-           }
-       }
-       mon_exit( &sglob->tsl_mon );
-       interval.tv_usec = 0L;
-       if ( min == 0L ) {
-           interval.tv_sec = 1L;
-       } else {
-           interval.tv_sec = min;
-       }
-       lwp_sleep( &interval );
-    }
-    mon_enter( &sglob->tsl_mon );
-    for ( t = sglob->tsl_list; t != NULL; t = t->tl_next ) {
-       lwp_resume( t->tl_tid );
-    }
-    mon_exit( &sglob->tsl_mon );
-    free_stack( stackno );
-}
-
-
-/*
- * Create the lwp_scheduler thread.
- */
-void
-start_lwp_scheduler( void )
-{
-    thread_t   tid;
-    stkalign_t *stack;
-    int                stackno;
-
-    if (( stack = get_stack( &stackno )) == NULL ) {
-       return;
-    }
-    lwp_create( &tid, lwp_scheduler, MINPRIO, 0, stack, 1, stackno );
-    return;
-}
-
-
-#else /* !HAVE_LWP */
-
-/*
- * Here we assume we have fully preemptive threads, and that sleep()
- * does the right thing.
- */
-int
-tsleep(
-    time_t     interval
-)
-{
-    sleep( interval );
-    return 0;
-}
-#endif /* !HAVE_LWP */