From 0eb2572d79822d02ea05448ce4e5f1759c73d171 Mon Sep 17 00:00:00 2001 From: Michael Graff Date: Thu, 22 Jun 2000 01:48:24 +0000 Subject: [PATCH] add isc_thread_setconcurrency() --- acconfig.h | 5 + bin/tests/entropy2_test.c | 10 - config.h.in | 5 + configure | 269 +++++++++++++++----------- configure.in | 4 +- lib/isc/pthreads/include/isc/thread.h | 3 + lib/isc/pthreads/thread.c | 10 + 7 files changed, 186 insertions(+), 120 deletions(-) diff --git a/acconfig.h b/acconfig.h index 7495c7e965..eda986ef21 100644 --- a/acconfig.h +++ b/acconfig.h @@ -65,6 +65,11 @@ /* define is getaddrinfo() exists */ #undef HAVE_GETADDRINFO +/* define if pthread_setconcurrency() should be called to tell the + * OS how many threads we might want to run. + */ +#undef CALL_PTHREAD_SETCONCURRENCY + /* Shut up warnings about sputaux in stdio.h on BSD/OS pre-4.1 */ #undef SHUTUP_SPUTAUX #ifdef SHUTUP_SPUTAUX diff --git a/bin/tests/entropy2_test.c b/bin/tests/entropy2_test.c index 9dad627193..1d816b1e25 100644 --- a/bin/tests/entropy2_test.c +++ b/bin/tests/entropy2_test.c @@ -76,11 +76,6 @@ stop(isc_entropysource_t *source, void *arg) { printf("stop called\n"); } -/* - * This function is by no way a good one to actually add entropy into - * the system. It is intended to fool the entropy system into beliving - * there are actual bits from us. - */ static isc_result_t get(isc_entropysource_t *source, void *arg, isc_boolean_t blocking) { isc_keyboard_t *kbd = (isc_keyboard_t *)arg; @@ -90,11 +85,6 @@ get(isc_entropysource_t *source, void *arg, isc_boolean_t blocking) { isc_uint32_t extra; unsigned char c; - /* - * Here, we should check to see if we are in blocking mode or not. - * If we will block and the application asked us not to, - * we should return an error instead, rather than block. - */ if (!blocking) return (ISC_R_NOENTROPY); diff --git a/config.h.in b/config.h.in index c954469e9c..b52ef9a54b 100644 --- a/config.h.in +++ b/config.h.in @@ -76,6 +76,11 @@ /* define is getaddrinfo() exists */ #undef HAVE_GETADDRINFO +/* define if pthread_setconcurrency() should be called to tell the + * OS how many threads we might want to run. + */ +#undef CALL_PTHREAD_SETCONCURRENCY + /* Shut up warnings about sputaux in stdio.h on BSD/OS pre-4.1 */ #undef SHUTUP_SPUTAUX #ifdef SHUTUP_SPUTAUX diff --git a/configure b/configure index 5fd2bc6c18..e74afd7802 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh -# From configure.in Revision: 1.154 +# From configure.in Revision: 1.155 @@ -2271,6 +2271,57 @@ EOF #define _POSIX_PTHREAD_SEMANTICS 1 EOF + echo $ac_n "checking for pthread_setconcurrency""... $ac_c" 1>&6 +echo "configure:2276: checking for pthread_setconcurrency" >&5 +if eval "test \"`echo '$''{'ac_cv_func_pthread_setconcurrency'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_setconcurrency(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_pthread_setconcurrency) || defined (__stub___pthread_setconcurrency) +choke me +#else +pthread_setconcurrency(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_pthread_setconcurrency=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_pthread_setconcurrency=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'pthread_setconcurrency`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define CALL_PTHREAD_SETCONCURRENCY 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + ;; # # UnixWare does things its own way. @@ -2287,12 +2338,12 @@ esac # Look for sysconf to allow detection of the number of processors. # echo $ac_n "checking for sysconf""... $ac_c" 1>&6 -echo "configure:2291: checking for sysconf" >&5 +echo "configure:2342: checking for sysconf" >&5 if eval "test \"`echo '$''{'ac_cv_func_sysconf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_sysconf=yes" else @@ -2342,12 +2393,12 @@ fi # NLS # echo $ac_n "checking for catgets""... $ac_c" 1>&6 -echo "configure:2346: checking for catgets" >&5 +echo "configure:2397: checking for catgets" >&5 if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_catgets=yes" else @@ -2408,7 +2459,7 @@ case "$host" in ;; *) echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:2412: checking for socket in -lsocket" >&5 +echo "configure:2463: checking for socket in -lsocket" >&5 ac_lib_var=`echo socket'_'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 @@ -2416,7 +2467,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2455,7 +2506,7 @@ else fi echo $ac_n "checking for inet_ntoa in -lnsl""... $ac_c" 1>&6 -echo "configure:2459: checking for inet_ntoa in -lnsl" >&5 +echo "configure:2510: checking for inet_ntoa in -lnsl" >&5 ac_lib_var=`echo nsl'_'inet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2463,7 +2514,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2583,9 +2634,9 @@ esac # Look for a 4.4BSD-style sa_len member in struct sockaddr. # echo $ac_n "checking for sa_len in struct sockaddr""... $ac_c" 1>&6 -echo "configure:2587: checking for sa_len in struct sockaddr" >&5 +echo "configure:2638: checking for sa_len in struct sockaddr" >&5 cat > conftest.$ac_ext < @@ -2594,7 +2645,7 @@ int main() { struct sockaddr sa; sa.sa_len = 0; return (0); ; return 0; } EOF -if { (eval echo configure:2598: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1" @@ -2615,9 +2666,9 @@ rm -f conftest* # Look for a 4.4BSD or 4.3BSD struct msghdr # echo $ac_n "checking for struct msghdr flavor""... $ac_c" 1>&6 -echo "configure:2619: checking for struct msghdr flavor" >&5 +echo "configure:2670: checking for struct msghdr flavor" >&5 cat > conftest.$ac_ext < @@ -2626,7 +2677,7 @@ int main() { struct msghdr msg; msg.msg_flags = 0; return (0); ; return 0; } EOF -if { (eval echo configure:2630: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""4.4BSD" 1>&6 ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1" @@ -2644,9 +2695,9 @@ rm -f conftest* # Look for in_port_t. # echo $ac_n "checking for type in_port_t""... $ac_c" 1>&6 -echo "configure:2648: checking for type in_port_t" >&5 +echo "configure:2699: checking for type in_port_t" >&5 cat > conftest.$ac_ext < @@ -2655,7 +2706,7 @@ int main() { in_port_t port = 25; return (0); ; return 0; } EOF -if { (eval echo configure:2659: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT" @@ -2673,9 +2724,9 @@ rm -f conftest* # Check for addrinfo # echo $ac_n "checking for struct addrinfo""... $ac_c" 1>&6 -echo "configure:2677: checking for struct addrinfo" >&5 +echo "configure:2728: checking for struct addrinfo" >&5 cat > conftest.$ac_ext < @@ -2683,7 +2734,7 @@ int main() { struct addrinfo a; return (0); ; return 0; } EOF -if { (eval echo configure:2687: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO" @@ -2702,9 +2753,9 @@ rm -f conftest* echo $ac_n "checking for int sethostent""... $ac_c" 1>&6 -echo "configure:2706: checking for int sethostent" >&5 +echo "configure:2757: checking for int sethostent" >&5 cat > conftest.$ac_ext < @@ -2712,7 +2763,7 @@ int main() { int i = sethostent(0); return(0); ; return 0; } EOF -if { (eval echo configure:2716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1" @@ -2727,9 +2778,9 @@ rm -f conftest* echo $ac_n "checking for int endhostent""... $ac_c" 1>&6 -echo "configure:2731: checking for int endhostent" >&5 +echo "configure:2782: checking for int endhostent" >&5 cat > conftest.$ac_ext < @@ -2737,7 +2788,7 @@ int main() { int i = endhostent(); return(0); ; return 0; } EOF -if { (eval echo configure:2741: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2792: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1" @@ -2752,9 +2803,9 @@ rm -f conftest* echo $ac_n "checking for getnetbyaddr(in_addr_t, ...)""... $ac_c" 1>&6 -echo "configure:2756: checking for getnetbyaddr(in_addr_t, ...)" >&5 +echo "configure:2807: checking for getnetbyaddr(in_addr_t, ...)" >&5 cat > conftest.$ac_ext < @@ -2763,7 +2814,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2818: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1" @@ -2778,9 +2829,9 @@ rm -f conftest* echo $ac_n "checking for int setnetent""... $ac_c" 1>&6 -echo "configure:2782: checking for int setnetent" >&5 +echo "configure:2833: checking for int setnetent" >&5 cat > conftest.$ac_ext < @@ -2788,7 +2839,7 @@ int main() { int i = setnetent(0); return(0); ; return 0; } EOF -if { (eval echo configure:2792: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2843: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1" @@ -2803,9 +2854,9 @@ rm -f conftest* echo $ac_n "checking for int endnetent""... $ac_c" 1>&6 -echo "configure:2807: checking for int endnetent" >&5 +echo "configure:2858: checking for int endnetent" >&5 cat > conftest.$ac_ext < @@ -2813,7 +2864,7 @@ int main() { int i = endnetent(); return(0); ; return 0; } EOF -if { (eval echo configure:2817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2868: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1" @@ -2828,9 +2879,9 @@ rm -f conftest* echo $ac_n "checking for gethostbyadd(const void *, size_t, ...)""... $ac_c" 1>&6 -echo "configure:2832: checking for gethostbyadd(const void *, size_t, ...)" >&5 +echo "configure:2883: checking for gethostbyadd(const void *, size_t, ...)" >&5 cat > conftest.$ac_ext < @@ -2839,7 +2890,7 @@ int main() { return(0); ; return 0; } EOF -if { (eval echo configure:2843: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2894: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1" @@ -2854,9 +2905,9 @@ rm -f conftest* echo $ac_n "checking for h_errno in netdb.h""... $ac_c" 1>&6 -echo "configure:2858: checking for h_errno in netdb.h" >&5 +echo "configure:2909: checking for h_errno in netdb.h" >&5 cat > conftest.$ac_ext < @@ -2864,7 +2915,7 @@ int main() { h_errno = 1; return(0); ; return 0; } EOF -if { (eval echo configure:2868: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2919: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO" @@ -2879,12 +2930,12 @@ rm -f conftest* echo $ac_n "checking for getipnodebyname""... $ac_c" 1>&6 -echo "configure:2883: checking for getipnodebyname" >&5 +echo "configure:2934: checking for getipnodebyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_getipnodebyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_getipnodebyname=yes" else @@ -2928,12 +2979,12 @@ ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1" fi echo $ac_n "checking for getnameinfo""... $ac_c" 1>&6 -echo "configure:2932: checking for getnameinfo" >&5 +echo "configure:2983: checking for getnameinfo" >&5 if eval "test \"`echo '$''{'ac_cv_func_getnameinfo'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_getnameinfo=yes" else @@ -2977,12 +3028,12 @@ ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1" fi echo $ac_n "checking for getaddrinfo""... $ac_c" 1>&6 -echo "configure:2981: checking for getaddrinfo" >&5 +echo "configure:3032: checking for getaddrinfo" >&5 if eval "test \"`echo '$''{'ac_cv_func_getaddrinfo'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_getaddrinfo=yes" else @@ -3037,9 +3088,9 @@ fi # Look for a sysctl call to get the list of network interfaces. # echo $ac_n "checking for interface list sysctl""... $ac_c" 1>&6 -echo "configure:3041: checking for interface list sysctl" >&5 +echo "configure:3092: checking for interface list sysctl" >&5 cat > conftest.$ac_ext < @@ -3149,7 +3200,7 @@ else fi echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:3153: checking build system type" >&5 +echo "configure:3204: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -3178,7 +3229,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:3182: checking for ld used by GCC" >&5 +echo "configure:3233: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. @@ -3202,10 +3253,10 @@ echo "configure:3182: 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:3206: checking for GNU ld" >&5 +echo "configure:3257: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:3209: checking for non-GNU ld" >&5 +echo "configure:3260: 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 @@ -3241,7 +3292,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:3245: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:3296: 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 @@ -3257,7 +3308,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:3261: checking for BSD-compatible nm" >&5 +echo "configure:3312: 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 @@ -3294,7 +3345,7 @@ echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:3298: checking whether ln -s works" >&5 +echo "configure:3349: 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 @@ -3338,8 +3389,8 @@ test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" case "$host" in *-*-irix6*) # Find out which ABI we are using. - echo '#line 3342 "configure"' > conftest.$ac_ext - if { (eval echo configure:3343: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 3393 "configure"' > conftest.$ac_ext + if { (eval echo configure:3394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *32-bit*) LD="${LD-ld} -32" @@ -3360,19 +3411,19 @@ case "$host" in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:3364: checking whether the C compiler needs -belf" >&5 +echo "configure:3415: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -3509,9 +3560,9 @@ fi case "$enable_ipv6" in yes|''|autodetect) echo $ac_n "checking for IPv6 structures""... $ac_c" 1>&6 -echo "configure:3513: checking for IPv6 structures" >&5 +echo "configure:3564: checking for IPv6 structures" >&5 cat > conftest.$ac_ext < @@ -3521,7 +3572,7 @@ int main() { struct sockaddr_in6 sin6; return (0); ; return 0; } EOF -if { (eval echo configure:3525: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3576: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 found_ipv6=yes @@ -3544,7 +3595,7 @@ esac # This is done before other IPv6 linking tests to LIBS is properly set. # echo $ac_n "checking for Kame IPv6 support""... $ac_c" 1>&6 -echo "configure:3548: checking for Kame IPv6 support" >&5 +echo "configure:3599: checking for Kame IPv6 support" >&5 # Check whether --with-kame or --without-kame was given. if test "${with_kame+set}" = set; then withval="$with_kame" @@ -3632,9 +3683,9 @@ case "$found_ipv6" in LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1" echo $ac_n "checking for in6addr_any""... $ac_c" 1>&6 -echo "configure:3636: checking for in6addr_any" >&5 +echo "configure:3687: checking for in6addr_any" >&5 cat > conftest.$ac_ext < @@ -3645,7 +3696,7 @@ int main() { struct in6_addr in6; in6 = in6addr_any; return (0); ; return 0; } EOF -if { (eval echo configure:3649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY" @@ -3661,9 +3712,9 @@ fi rm -f conftest* echo $ac_n "checking for sin6_scope_id in struct sockaddr_in6""... $ac_c" 1>&6 -echo "configure:3665: checking for sin6_scope_id in struct sockaddr_in6" >&5 +echo "configure:3716: checking for sin6_scope_id in struct sockaddr_in6" >&5 cat > conftest.$ac_ext < @@ -3676,7 +3727,7 @@ int main() { struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0); ; return 0; } EOF -if { (eval echo configure:3680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 result="#define LWRES_HAVE_SIN6_SCOPE_ID 1" @@ -3691,9 +3742,9 @@ rm -f conftest* LWRES_HAVE_SIN6_SCOPE_ID="$result" echo $ac_n "checking for in6_pktinfo""... $ac_c" 1>&6 -echo "configure:3695: checking for in6_pktinfo" >&5 +echo "configure:3746: checking for in6_pktinfo" >&5 cat > conftest.$ac_ext < @@ -3706,7 +3757,7 @@ int main() { struct in6_pktinfo xyzzy; return (0); ; return 0; } EOF -if { (eval echo configure:3710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1" @@ -3753,9 +3804,9 @@ esac # the files. # echo $ac_n "checking for inet_ntop""... $ac_c" 1>&6 -echo "configure:3757: checking for inet_ntop" >&5 +echo "configure:3808: checking for inet_ntop" >&5 cat > conftest.$ac_ext < @@ -3765,7 +3816,7 @@ int main() { inet_ntop(0, 0, 0, 0); return (0); ; return 0; } EOF -if { (eval echo configure:3769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP" @@ -3780,9 +3831,9 @@ else fi rm -f conftest* echo $ac_n "checking for inet_pton""... $ac_c" 1>&6 -echo "configure:3784: checking for inet_pton" >&5 +echo "configure:3835: checking for inet_pton" >&5 cat > conftest.$ac_ext < @@ -3792,7 +3843,7 @@ int main() { inet_pton(0, 0, 0); return (0); ; return 0; } EOF -if { (eval echo configure:3796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON" @@ -3807,9 +3858,9 @@ else fi rm -f conftest* echo $ac_n "checking for inet_aton""... $ac_c" 1>&6 -echo "configure:3811: checking for inet_aton" >&5 +echo "configure:3862: checking for inet_aton" >&5 cat > conftest.$ac_ext < @@ -3819,7 +3870,7 @@ int main() { struct in_addr in; inet_aton(0, &in); return (0); ; return 0; } EOF -if { (eval echo configure:3823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_PLATFORM_NEEDATON="#undef ISC_PLATFORM_NEEDATON" @@ -3840,12 +3891,12 @@ rm -f conftest* # Check for some other useful functions that are not ever-present. echo $ac_n "checking for strsep""... $ac_c" 1>&6 -echo "configure:3844: checking for strsep" >&5 +echo "configure:3895: checking for strsep" >&5 if eval "test \"`echo '$''{'ac_cv_func_strsep'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strsep=yes" else @@ -3889,12 +3940,12 @@ ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1" fi echo $ac_n "checking for vsnprintf""... $ac_c" 1>&6 -echo "configure:3893: checking for vsnprintf" >&5 +echo "configure:3944: checking for vsnprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vsnprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vsnprintf=yes" else @@ -3946,17 +3997,17 @@ fi echo $ac_n "checking for sizeof(long long int) == sizeof(long int)""... $ac_c" 1>&6 -echo "configure:3950: checking for sizeof(long long int) == sizeof(long int)" >&5 +echo "configure:4001: checking for sizeof(long long int) == sizeof(long int)" >&5 if test "$cross_compiling" = yes; then echo "$ac_t""default yes" 1>&6 ISC_PLATFORM_LONGLONGEQUALLONG="#define ISC_PLATFORM_LONGLONGEQUALLONG 1" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then echo "$ac_t""yes" 1>&6 ISC_PLATFORM_LONGLONGEQUALLONG="#define ISC_PLATFORM_LONGLONGEQUALLONG 1" @@ -3976,12 +4027,12 @@ fi # Security Stuff # echo $ac_n "checking for chroot""... $ac_c" 1>&6 -echo "configure:3980: checking for chroot" >&5 +echo "configure:4031: checking for chroot" >&5 if eval "test \"`echo '$''{'ac_cv_func_chroot'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_chroot=yes" else @@ -4030,17 +4081,17 @@ for ac_hdr in linux/capability.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4034: checking for $ac_hdr" >&5 +echo "configure:4085: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4044: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4095: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4070,17 +4121,17 @@ for ac_hdr in linux/prctl.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4074: checking for $ac_hdr" >&5 +echo "configure:4125: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4084: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4135: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* diff --git a/configure.in b/configure.in index c5f49a85d6..5f3d88a057 100644 --- a/configure.in +++ b/configure.in @@ -13,7 +13,7 @@ dnl PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS dnl ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS dnl SOFTWARE. -AC_REVISION($Revision: 1.155 $) +AC_REVISION($Revision: 1.156 $) AC_PREREQ(2.13) @@ -312,6 +312,8 @@ case "$host" in # *-solaris*) AC_DEFINE(_POSIX_PTHREAD_SEMANTICS) + AC_CHECK_FUNC(pthread_setconcurrency, + AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY)) ;; # # UnixWare does things its own way. diff --git a/lib/isc/pthreads/include/isc/thread.h b/lib/isc/pthreads/include/isc/thread.h index d8ae627fc9..d027e63cc8 100644 --- a/lib/isc/pthreads/include/isc/thread.h +++ b/lib/isc/pthreads/include/isc/thread.h @@ -33,6 +33,9 @@ typedef isc_threadresult_t (*isc_threadfunc_t)(isc_threadarg_t); isc_result_t isc_thread_create(isc_threadfunc_t, isc_threadarg_t, isc_thread_t *); +void +isc_thread_setconcurrency(unsigned int level); + /* XXX We could do fancier error handling... */ #define isc_thread_join(t, rp) \ diff --git a/lib/isc/pthreads/thread.c b/lib/isc/pthreads/thread.c index 5941300b05..9d33d81e39 100644 --- a/lib/isc/pthreads/thread.c +++ b/lib/isc/pthreads/thread.c @@ -18,6 +18,7 @@ #include #include +#include #ifndef THREAD_MINSTACKSIZE #define THREAD_MINSTACKSIZE (64 * 1024) @@ -51,3 +52,12 @@ isc_thread_create(isc_threadfunc_t func, isc_threadarg_t arg, return (ISC_R_SUCCESS); } + +void +isc_thread_setconcurrency(unsigned int level) { +#if defined(CALL_PTHREAD_SETCONCURRENCY) + (void)pthread_setconcurrency(level); +#else + UNUSED(level); +#endif +}