From: adrian <> Date: Mon, 24 Dec 2001 22:33:40 +0000 (+0000) Subject: Break out the comm code into a more "modular" format - poll code X-Git-Tag: SQUID_3_0_PRE1~1240 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b3db6d92da76719fef67d8dec547908f971c5b6;p=thirdparty%2Fsquid.git Break out the comm code into a more "modular" format - poll code in comm_poll.c, select code in comm_select.c . Rename some of the relevant #defines (HAVE_POLL/USE_POLL) whilst I'm at it to make things consistent. --- diff --git a/configure b/configure index e33db69638..0740e16684 100755 --- a/configure +++ b/configure @@ -112,12 +112,14 @@ ac_help="$ac_help ac_help="$ac_help --with-coss-membuf-size COSS membuf size (default 1048576 bytes) " ac_help="$ac_help - --enable-poll Enable poll() instead of select(). Normally poll - is preferred over select, but configure knows poll - is broken on some platforms. If you think you are - smarter than the configure script, you may enable - poll with this option. - --disable-poll Disable the use of poll()." + --enable-poll Enable poll() support. + --disable-poll Disable poll() support. " +ac_help="$ac_help + --enable-select Enable select() support. + --disable-select Disable select() support. " +ac_help="$ac_help + --enable-kqueue Enable kqueue() support. + --disable-kqueue Disable kqueue() support. " ac_help="$ac_help --disable-http-violations This allows you to remove code which is known to @@ -745,7 +747,7 @@ am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd` # 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:749: checking for a BSD compatible install" >&5 +echo "configure:751: 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 @@ -798,7 +800,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:802: checking whether build environment is sane" >&5 +echo "configure:804: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftest.file @@ -869,7 +871,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:873: checking for $ac_word" >&5 +echo "configure:875: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -899,7 +901,7 @@ test -n "$AWK" && break done echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:903: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:905: 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 @@ -1018,9 +1020,9 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" -# From configure.in Revision: 1.251 +# From configure.in Revision: 1.252 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:1024: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:1026: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -1052,7 +1054,7 @@ PRESET_CFLAGS="$CFLAGS" # 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:1056: checking for $ac_word" >&5 +echo "configure:1058: 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 @@ -1082,7 +1084,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:1086: checking for $ac_word" >&5 +echo "configure:1088: 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 @@ -1133,7 +1135,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1137: checking for $ac_word" >&5 +echo "configure:1139: 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 @@ -1165,7 +1167,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1169: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1171: 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. @@ -1176,12 +1178,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1180 "configure" +#line 1182 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 @@ -1207,12 +1209,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:1211: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1213: 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:1216: checking whether we are using GNU C" >&5 +echo "configure:1218: 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 @@ -1221,7 +1223,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1225: \"$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:1227: \"$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 @@ -1240,7 +1242,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1244: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1246: 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 @@ -1279,7 +1281,7 @@ doit: END # If we don't find an include directive, just comment out the code. echo $ac_n "checking for style of include used by $am_make""... $ac_c" 1>&6 -echo "configure:1283: checking for style of include used by $am_make" >&5 +echo "configure:1285: checking for style of include used by $am_make" >&5 am__include='#' am__quote= _am_result=none @@ -1313,7 +1315,7 @@ rm -f confinc confmf depcc="$CC" am_compiler_list= echo $ac_n "checking dependency style of $depcc""... $ac_c" 1>&6 -echo "configure:1317: checking dependency style of $depcc" >&5 +echo "configure:1319: checking dependency style of $depcc" >&5 if eval "test \"`echo '$''{'am_cv_CC_dependencies_compiler_type'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1381,10 +1383,10 @@ CCDEPMODE="depmode=$am_cv_CC_dependencies_compiler_type" if test "x$CC" != xcc; then echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6 -echo "configure:1385: checking whether $CC and cc understand -c and -o together" >&5 +echo "configure:1387: checking whether $CC and cc understand -c and -o together" >&5 else echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6 -echo "configure:1388: checking whether cc understands -c and -o together" >&5 +echo "configure:1390: checking whether cc understands -c and -o together" >&5 fi set dummy $CC; ac_cc="`echo $2 | sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`" @@ -1396,16 +1398,16 @@ else # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5' -if { (eval echo configure:1400: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && - test -f conftest.o && { (eval echo configure:1401: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; +if { (eval echo configure:1402: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && + test -f conftest.o && { (eval echo configure:1403: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. - if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1406: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1408: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then ac_try='cc -c conftest.c -o conftest.o 1>&5' - if { (eval echo configure:1408: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && - test -f conftest.o && { (eval echo configure:1409: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; + if { (eval echo configure:1410: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && + test -f conftest.o && { (eval echo configure:1411: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then # cc works too. : @@ -1451,7 +1453,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:1455: checking host system type" >&5 +echo "configure:1457: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -1478,12 +1480,12 @@ REGEXLIB='' # -lregex LIBREGEX='' # libregex.a echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1482: checking for Cygwin environment" >&5 +echo "configure:1484: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -1511,19 +1513,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1515: checking for mingw32 environment" >&5 +echo "configure:1517: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1529: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -1542,7 +1544,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1546: checking for executable suffix" >&5 +echo "configure:1548: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1552,10 +1554,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj) ;; + *.c | *.C | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -1573,13 +1575,13 @@ echo "$ac_t""${ac_cv_exeext}" 1>&6 ac_exeext=$EXEEXT echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1577: checking for object suffix" >&5 +echo "configure:1579: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1583: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1585: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -2465,7 +2467,7 @@ fi # Check whether --enable-poll or --disable-poll was given. if test "${enable_poll+set}" = set; then enableval="$enable_poll" - + case "$enableval" in yes) echo "Forcing poll() to be enabled" @@ -2480,6 +2482,42 @@ if test "${enable_poll+set}" = set; then fi +# Check whether --enable-select or --disable-select was given. +if test "${enable_select+set}" = set; then + enableval="$enable_select" + + case "$enableval" in + yes) + echo "Forcing select() to be enabled" + ac_cv_func_select='yes' + ;; + no) + echo "Forcing select() to be disabled" + ac_cv_func_select='no' + ;; + esac + +fi + + +# Check whether --enable-kqueue or --disable-kqueue was given. +if test "${enable_kqueue+set}" = set; then + enableval="$enable_kqueue" + + case "$enableval" in + yes) + echo "Forcing kqueue() to be enabled" + ac_cv_func_kqueue='yes' + ;; + no) + echo "Forcing kqueue() to be disabled" + ac_cv_func_kqueue='no' + ;; +esac + +fi + + # Check whether --enable-http-violations or --disable-http-violations was given. if test "${enable_http_violations+set}" = set; then enableval="$enable_http_violations" @@ -2885,7 +2923,7 @@ case "$host" in esac echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2889: checking how to run the C preprocessor" >&5 +echo "configure:2927: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2900,13 +2938,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2948: \"$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 : @@ -2917,13 +2955,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2965: \"$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 : @@ -2934,13 +2972,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2944: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2982: \"$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 : @@ -2976,7 +3014,7 @@ echo "$ac_t""$CPP" 1>&6 # 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:2980: checking for a BSD compatible install" >&5 +echo "configure:3018: 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 @@ -3031,7 +3069,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:3035: checking for $ac_word" >&5 +echo "configure:3073: 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 @@ -3059,7 +3097,7 @@ else fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:3063: checking whether ln -s works" >&5 +echo "configure:3101: 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 @@ -3082,7 +3120,7 @@ fi # Extract the first word of "sh", so it can be a program name with args. set dummy sh; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3086: checking for $ac_word" >&5 +echo "configure:3124: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3118,7 +3156,7 @@ fi # Extract the first word of "false", so it can be a program name with args. set dummy false; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3122: checking for $ac_word" >&5 +echo "configure:3160: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_FALSE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3154,7 +3192,7 @@ fi # Extract the first word of "true", so it can be a program name with args. set dummy true; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3158: checking for $ac_word" >&5 +echo "configure:3196: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_TRUE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3190,7 +3228,7 @@ fi # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3194: checking for $ac_word" >&5 +echo "configure:3232: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_RM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3226,7 +3264,7 @@ fi # Extract the first word of "mv", so it can be a program name with args. set dummy mv; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3230: checking for $ac_word" >&5 +echo "configure:3268: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MV'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3262,7 +3300,7 @@ fi # Extract the first word of "mkdir", so it can be a program name with args. set dummy mkdir; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3266: checking for $ac_word" >&5 +echo "configure:3304: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MKDIR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3298,7 +3336,7 @@ fi # Extract the first word of "ln", so it can be a program name with args. set dummy ln; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3302: checking for $ac_word" >&5 +echo "configure:3340: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_LN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3334,7 +3372,7 @@ fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3338: checking for $ac_word" >&5 +echo "configure:3376: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3370,7 +3408,7 @@ fi # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3374: checking for $ac_word" >&5 +echo "configure:3412: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3430,12 +3468,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:3434: checking for $ac_hdr that defines DIR" >&5 +echo "configure:3472: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -3443,7 +3481,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:3447: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3485: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -3468,7 +3506,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:3472: checking for opendir in -ldir" >&5 +echo "configure:3510: 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 @@ -3476,7 +3514,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3529: \"$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 @@ -3509,7 +3547,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:3513: checking for opendir in -lx" >&5 +echo "configure:3551: 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 @@ -3517,7 +3555,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3570: \"$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 @@ -3551,12 +3589,12 @@ fi fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3555: checking for ANSI C header files" >&5 +echo "configure:3593: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3564,7 +3602,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3568: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3606: \"$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* @@ -3581,7 +3619,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 @@ -3599,7 +3637,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 @@ -3620,7 +3658,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3631,7 +3669,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:3635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3736,17 +3774,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:3740: checking for $ac_hdr" >&5 +echo "configure:3778: 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:3750: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3788: \"$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* @@ -3774,12 +3812,12 @@ done echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3778: checking for working const" >&5 +echo "configure:3816: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3870: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3849,14 +3887,14 @@ EOF fi echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:3853: checking whether byte ordering is bigendian" >&5 +echo "configure:3891: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -3867,11 +3905,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:3871: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3909: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -3882,7 +3920,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:3886: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3924: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -3902,7 +3940,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -3940,20 +3978,20 @@ fi echo $ac_n "checking if ANSI prototypes work""... $ac_c" 1>&6 -echo "configure:3944: checking if ANSI prototypes work" >&5 +echo "configure:3982: checking if ANSI prototypes work" >&5 if eval "test \"`echo '$''{'ac_cv_have_ansi_prototypes'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_ansi_prototypes="yes" else @@ -3975,13 +4013,13 @@ EOF fi echo $ac_n "checking for tm->tm_gmtoff""... $ac_c" 1>&6 -echo "configure:3979: checking for tm->tm_gmtoff" >&5 +echo "configure:4017: checking for tm->tm_gmtoff" >&5 if eval "test \"`echo '$''{'ac_cv_have_tm_gmoff'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3990,7 +4028,7 @@ struct tm foo; foo.tm_gmtoff = 0; ; return 0; } EOF -if { (eval echo configure:3994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4032: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_tm_gmoff="yes" else @@ -4012,13 +4050,13 @@ EOF fi echo $ac_n "checking for struct mallinfo""... $ac_c" 1>&6 -echo "configure:4016: checking for struct mallinfo" >&5 +echo "configure:4054: checking for struct mallinfo" >&5 if eval "test \"`echo '$''{'ac_cv_have_struct_mallinfo'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if HAVE_MALLOC_H @@ -4036,7 +4074,7 @@ struct mallinfo foo; foo.keepcost = 0; ; return 0; } EOF -if { (eval echo configure:4040: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4078: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_struct_mallinfo="yes" else @@ -4058,13 +4096,13 @@ EOF fi echo $ac_n "checking for extended mallinfo""... $ac_c" 1>&6 -echo "configure:4062: checking for extended mallinfo" >&5 +echo "configure:4100: checking for extended mallinfo" >&5 if eval "test \"`echo '$''{'ac_cv_have_ext_mallinfo'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4073,7 +4111,7 @@ struct mallinfo foo; foo.mxfast = 0; ; return 0; } EOF -if { (eval echo configure:4077: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_ext_mallinfo="yes" else @@ -4095,13 +4133,13 @@ EOF fi echo $ac_n "checking for struct rusage""... $ac_c" 1>&6 -echo "configure:4099: checking for struct rusage" >&5 +echo "configure:4137: checking for struct rusage" >&5 if eval "test \"`echo '$''{'ac_cv_have_struct_rusage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4156: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_struct_rusage="yes" else @@ -4136,13 +4174,13 @@ EOF fi echo $ac_n "checking for ip->ip_hl""... $ac_c" 1>&6 -echo "configure:4140: checking for ip->ip_hl" >&5 +echo "configure:4178: checking for ip->ip_hl" >&5 if eval "test \"`echo '$''{'ac_cv_have_ip_hl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4161,7 +4199,7 @@ struct iphdr ip; ip.ip_hl= 0; ; return 0; } EOF -if { (eval echo configure:4165: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4203: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_ip_hl="yes" else @@ -4183,7 +4221,7 @@ EOF fi echo $ac_n "checking size of void *""... $ac_c" 1>&6 -echo "configure:4187: checking size of void *" >&5 +echo "configure:4225: checking size of void *" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4191,7 +4229,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4202,7 +4240,7 @@ main() exit(0); } EOF -if { (eval echo configure:4206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_void_p=`cat conftestval` else @@ -4222,7 +4260,7 @@ EOF echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:4226: checking size of short" >&5 +echo "configure:4264: 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 @@ -4230,7 +4268,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4241,7 +4279,7 @@ main() exit(0); } EOF -if { (eval echo configure:4245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else @@ -4261,7 +4299,7 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:4265: checking size of int" >&5 +echo "configure:4303: 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 @@ -4269,7 +4307,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4280,7 +4318,7 @@ main() exit(0); } EOF -if { (eval echo configure:4284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -4300,7 +4338,7 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:4304: checking size of long" >&5 +echo "configure:4342: 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 @@ -4308,7 +4346,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4319,7 +4357,7 @@ main() exit(0); } EOF -if { (eval echo configure:4323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -4339,7 +4377,7 @@ EOF echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:4343: checking size of long long" >&5 +echo "configure:4381: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4347,7 +4385,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4358,7 +4396,7 @@ main() exit(0); } EOF -if { (eval echo configure:4362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else @@ -4378,7 +4416,7 @@ EOF echo $ac_n "checking size of __int64""... $ac_c" 1>&6 -echo "configure:4382: checking size of __int64" >&5 +echo "configure:4420: checking size of __int64" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof___int64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4386,7 +4424,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4397,7 +4435,7 @@ main() exit(0); } EOF -if { (eval echo configure:4401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof___int64=`cat conftestval` else @@ -4417,7 +4455,7 @@ EOF echo $ac_n "checking size of int16_t""... $ac_c" 1>&6 -echo "configure:4421: checking size of int16_t" >&5 +echo "configure:4459: checking size of int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4425,7 +4463,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4436,7 +4474,7 @@ main() exit(0); } EOF -if { (eval echo configure:4440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int16_t=`cat conftestval` else @@ -4456,7 +4494,7 @@ EOF echo $ac_n "checking size of uint16_t""... $ac_c" 1>&6 -echo "configure:4460: checking size of uint16_t" >&5 +echo "configure:4498: checking size of uint16_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_uint16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4464,7 +4502,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4475,7 +4513,7 @@ main() exit(0); } EOF -if { (eval echo configure:4479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_uint16_t=`cat conftestval` else @@ -4495,7 +4533,7 @@ EOF echo $ac_n "checking size of u_int16_t""... $ac_c" 1>&6 -echo "configure:4499: checking size of u_int16_t" >&5 +echo "configure:4537: checking size of u_int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_u_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4503,7 +4541,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4514,7 +4552,7 @@ main() exit(0); } EOF -if { (eval echo configure:4518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_u_int16_t=`cat conftestval` else @@ -4534,7 +4572,7 @@ EOF echo $ac_n "checking size of int32_t""... $ac_c" 1>&6 -echo "configure:4538: checking size of int32_t" >&5 +echo "configure:4576: checking size of int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4542,7 +4580,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4553,7 +4591,7 @@ main() exit(0); } EOF -if { (eval echo configure:4557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int32_t=`cat conftestval` else @@ -4573,7 +4611,7 @@ EOF echo $ac_n "checking size of uint32_t""... $ac_c" 1>&6 -echo "configure:4577: checking size of uint32_t" >&5 +echo "configure:4615: checking size of uint32_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_uint32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4581,7 +4619,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4592,7 +4630,7 @@ main() exit(0); } EOF -if { (eval echo configure:4596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_uint32_t=`cat conftestval` else @@ -4612,7 +4650,7 @@ EOF echo $ac_n "checking size of u_int32_t""... $ac_c" 1>&6 -echo "configure:4616: checking size of u_int32_t" >&5 +echo "configure:4654: checking size of u_int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_u_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4620,7 +4658,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4631,7 +4669,7 @@ main() exit(0); } EOF -if { (eval echo configure:4635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_u_int32_t=`cat conftestval` else @@ -4651,7 +4689,7 @@ EOF echo $ac_n "checking size of int64_t""... $ac_c" 1>&6 -echo "configure:4655: checking size of int64_t" >&5 +echo "configure:4693: checking size of int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4659,7 +4697,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4670,7 +4708,7 @@ main() exit(0); } EOF -if { (eval echo configure:4674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int64_t=`cat conftestval` else @@ -4690,7 +4728,7 @@ EOF echo $ac_n "checking size of uint64_t""... $ac_c" 1>&6 -echo "configure:4694: checking size of uint64_t" >&5 +echo "configure:4732: checking size of uint64_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_uint64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4698,7 +4736,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4709,7 +4747,7 @@ main() exit(0); } EOF -if { (eval echo configure:4713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_uint64_t=`cat conftestval` else @@ -4729,7 +4767,7 @@ EOF echo $ac_n "checking size of u_int64_t""... $ac_c" 1>&6 -echo "configure:4733: checking size of u_int64_t" >&5 +echo "configure:4771: checking size of u_int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_u_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4737,7 +4775,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4748,7 +4786,7 @@ main() exit(0); } EOF -if { (eval echo configure:4752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_u_int64_t=`cat conftestval` else @@ -4770,12 +4808,12 @@ EOF if test "x$ac_cv_sizeof_short" = "x2"; then echo $ac_n "checking for int16_t""... $ac_c" 1>&6 -echo "configure:4774: checking for int16_t" >&5 +echo "configure:4812: checking for int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4804,12 +4842,12 @@ fi elif test "x$ac_cv_sizeof_int" = "x2"; then echo $ac_n "checking for int16_t""... $ac_c" 1>&6 -echo "configure:4808: checking for int16_t" >&5 +echo "configure:4846: checking for int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4839,12 +4877,12 @@ fi fi if test "x$ac_cv_sizeof_uint16_t" = "x2"; then echo $ac_n "checking for u_int16_t""... $ac_c" 1>&6 -echo "configure:4843: checking for u_int16_t" >&5 +echo "configure:4881: checking for u_int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4873,12 +4911,12 @@ fi elif test "x$ac_cv_sizeof_short" = "x2"; then echo $ac_n "checking for u_int16_t""... $ac_c" 1>&6 -echo "configure:4877: checking for u_int16_t" >&5 +echo "configure:4915: checking for u_int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4907,12 +4945,12 @@ fi elif test "x$ac_cv_sizeof_int" = "x2"; then echo $ac_n "checking for u_int16_t""... $ac_c" 1>&6 -echo "configure:4911: checking for u_int16_t" >&5 +echo "configure:4949: checking for u_int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4942,12 +4980,12 @@ fi fi if test "x$ac_cv_sizeof_int" = "x4"; then echo $ac_n "checking for int32_t""... $ac_c" 1>&6 -echo "configure:4946: checking for int32_t" >&5 +echo "configure:4984: checking for int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4976,12 +5014,12 @@ fi elif "x$ac_cv_sizeof_long" = "x4"; then echo $ac_n "checking for int32_t""... $ac_c" 1>&6 -echo "configure:4980: checking for int32_t" >&5 +echo "configure:5018: checking for int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5011,12 +5049,12 @@ fi fi if test "x$ac_cv_sizeof_uint32_t" = "x4"; then echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6 -echo "configure:5015: checking for u_int32_t" >&5 +echo "configure:5053: checking for u_int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5045,12 +5083,12 @@ fi elif test "x$ac_cv_sizeof_int" = "x4"; then echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6 -echo "configure:5049: checking for u_int32_t" >&5 +echo "configure:5087: checking for u_int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5079,12 +5117,12 @@ fi elif test "x$ac_cv_sizeof_long" = "x4"; then echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6 -echo "configure:5083: checking for u_int32_t" >&5 +echo "configure:5121: checking for u_int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5114,12 +5152,12 @@ fi fi if test "x$ac_cv_sizeof_long" = "x8"; then echo $ac_n "checking for int64_t""... $ac_c" 1>&6 -echo "configure:5118: checking for int64_t" >&5 +echo "configure:5156: checking for int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5148,12 +5186,12 @@ fi elif test "x$ac_cv_sizeof_long_long" = "x8"; then echo $ac_n "checking for int64_t""... $ac_c" 1>&6 -echo "configure:5152: checking for int64_t" >&5 +echo "configure:5190: checking for int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5182,12 +5220,12 @@ fi elif test "x$ac_cv_sizeof___int64" = "x8"; then echo $ac_n "checking for int64_t""... $ac_c" 1>&6 -echo "configure:5186: checking for int64_t" >&5 +echo "configure:5224: checking for int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5217,12 +5255,12 @@ fi fi if test "x$ac_cv_sizeof_uint64_t" = "x8"; then echo $ac_n "checking for u_int64_t""... $ac_c" 1>&6 -echo "configure:5221: checking for u_int64_t" >&5 +echo "configure:5259: checking for u_int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5251,12 +5289,12 @@ fi elif test "x$ac_cv_sizeof_long" = "x8"; then echo $ac_n "checking for u_int64_t""... $ac_c" 1>&6 -echo "configure:5255: checking for u_int64_t" >&5 +echo "configure:5293: checking for u_int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5285,12 +5323,12 @@ fi elif test "x$ac_cv_sizeof_long_long" = "x8"; then echo $ac_n "checking for u_int64_t""... $ac_c" 1>&6 -echo "configure:5289: checking for u_int64_t" >&5 +echo "configure:5327: checking for u_int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5319,12 +5357,12 @@ fi elif test "x$ac_cv_sizeof___int64" = "x8"; then echo $ac_n "checking for int64_t""... $ac_c" 1>&6 -echo "configure:5323: checking for int64_t" >&5 +echo "configure:5361: checking for int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5354,12 +5392,12 @@ fi fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:5358: checking for pid_t" >&5 +echo "configure:5396: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5387,12 +5425,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:5391: checking for size_t" >&5 +echo "configure:5429: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5420,12 +5458,12 @@ EOF fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:5424: checking for ssize_t" >&5 +echo "configure:5462: checking for ssize_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5453,12 +5491,12 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:5457: checking for off_t" >&5 +echo "configure:5495: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5486,12 +5524,12 @@ EOF fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:5490: checking for mode_t" >&5 +echo "configure:5528: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5519,12 +5557,12 @@ EOF fi echo $ac_n "checking for fd_mask""... $ac_c" 1>&6 -echo "configure:5523: checking for fd_mask" >&5 +echo "configure:5561: checking for fd_mask" >&5 if eval "test \"`echo '$''{'ac_cv_type_fd_mask'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5555,19 +5593,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:5559: checking for working alloca.h" >&5 +echo "configure:5597: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:5571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -5588,12 +5626,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:5592: checking for alloca" >&5 +echo "configure:5630: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+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:5663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -5653,12 +5691,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:5657: checking whether alloca needs Cray hooks" >&5 +echo "configure:5695: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5687: checking for $ac_func" >&5 +echo "configure:5725: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5738,7 +5776,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:5742: checking stack direction for C alloca" >&5 +echo "configure:5780: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5746,7 +5784,7 @@ else ac_cv_c_stack_direction=0 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:5807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -5789,13 +5827,13 @@ fi echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 -echo "configure:5793: checking for socklen_t" >&5 +echo "configure:5831: checking for socklen_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5826,13 +5864,13 @@ EOF fi echo $ac_n "checking for mtyp_t""... $ac_c" 1>&6 -echo "configure:5830: checking for mtyp_t" >&5 +echo "configure:5868: checking for mtyp_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mtyp_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5860,7 +5898,7 @@ EOF fi echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 -echo "configure:5864: checking for main in -lnsl" >&5 +echo "configure:5902: 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 @@ -5868,14 +5906,14 @@ 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:5917: \"$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 @@ -5903,7 +5941,7 @@ else fi echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6 -echo "configure:5907: checking for main in -lsocket" >&5 +echo "configure:5945: 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 @@ -5911,14 +5949,14 @@ 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:5960: \"$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 @@ -5947,13 +5985,13 @@ fi echo $ac_n "checking for unix domain sockets""... $ac_c" 1>&6 -echo "configure:5951: checking for unix domain sockets" >&5 +echo "configure:5989: checking for unix domain sockets" >&5 if eval "test \"`echo '$''{'squid_cv_unixsocket'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5968,7 +6006,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6010: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* squid_cv_unixsocket=yes else @@ -5992,7 +6030,7 @@ if test "x$ac_cv_enabled_dlmalloc" = "xyes" ; then echo "skipping libmalloc check (--enable-dlmalloc specified)" else echo $ac_n "checking for main in -lgnumalloc""... $ac_c" 1>&6 -echo "configure:5996: checking for main in -lgnumalloc" >&5 +echo "configure:6034: checking for main in -lgnumalloc" >&5 ac_lib_var=`echo gnumalloc'_'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 @@ -6000,14 +6038,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lgnumalloc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6049: \"$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 @@ -6050,7 +6088,7 @@ fi *) echo $ac_n "checking for main in -lmalloc""... $ac_c" 1>&6 -echo "configure:6054: checking for main in -lmalloc" >&5 +echo "configure:6092: checking for main in -lmalloc" >&5 ac_lib_var=`echo malloc'_'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 @@ -6058,14 +6096,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lmalloc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6107: \"$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 @@ -6098,7 +6136,7 @@ fi fi echo $ac_n "checking for main in -lbsd""... $ac_c" 1>&6 -echo "configure:6102: checking for main in -lbsd" >&5 +echo "configure:6140: checking for main in -lbsd" >&5 ac_lib_var=`echo bsd'_'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 @@ -6106,14 +6144,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lbsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6155: \"$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 @@ -6141,7 +6179,7 @@ else fi echo $ac_n "checking for main in -lregex""... $ac_c" 1>&6 -echo "configure:6145: checking for main in -lregex" >&5 +echo "configure:6183: checking for main in -lregex" >&5 ac_lib_var=`echo regex'_'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 @@ -6149,14 +6187,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lregex $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6198: \"$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 @@ -6177,7 +6215,7 @@ else fi echo $ac_n "checking for gethostbyname in -lbind""... $ac_c" 1>&6 -echo "configure:6181: checking for gethostbyname in -lbind" >&5 +echo "configure:6219: checking for gethostbyname in -lbind" >&5 ac_lib_var=`echo bind'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6185,7 +6223,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbind $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6238: \"$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 @@ -6230,7 +6268,7 @@ if test $ac_cv_lib_bind_gethostbyname = "no" ; then ;; *) echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6 -echo "configure:6234: checking for inet_aton in -lresolv" >&5 +echo "configure:6272: checking for inet_aton in -lresolv" >&5 ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6238,7 +6276,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6291: \"$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 @@ -6265,7 +6303,7 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for inet_aton in -l44bsd""... $ac_c" 1>&6 -echo "configure:6269: checking for inet_aton in -l44bsd" >&5 +echo "configure:6307: checking for inet_aton in -l44bsd" >&5 ac_lib_var=`echo 44bsd'_'inet_aton | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6273,7 +6311,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l44bsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6326: \"$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 @@ -6316,7 +6354,7 @@ else fi echo $ac_n "checking for main in -lresolv""... $ac_c" 1>&6 -echo "configure:6320: checking for main in -lresolv" >&5 +echo "configure:6358: checking for main in -lresolv" >&5 ac_lib_var=`echo resolv'_'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 @@ -6324,14 +6362,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6373: \"$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 @@ -6362,7 +6400,7 @@ fi esac fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:6366: checking for main in -lm" >&5 +echo "configure:6404: checking for main in -lm" >&5 ac_lib_var=`echo m'_'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 @@ -6370,14 +6408,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6419: \"$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 @@ -6406,7 +6444,7 @@ fi echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:6410: checking for crypt in -lcrypt" >&5 +echo "configure:6448: 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 @@ -6414,7 +6452,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6467: \"$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 @@ -6448,7 +6486,7 @@ fi echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:6452: checking for dlopen in -ldl" >&5 +echo "configure:6490: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6456,7 +6494,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6509: \"$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 @@ -6490,7 +6528,7 @@ fi echo $ac_n "checking for main in -lpthread""... $ac_c" 1>&6 -echo "configure:6494: checking for main in -lpthread" >&5 +echo "configure:6532: checking for main in -lpthread" >&5 ac_lib_var=`echo pthread'_'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 @@ -6498,14 +6536,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6547: \"$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 @@ -6528,7 +6566,7 @@ fi echo $ac_n "checking for aio_read in -lrt""... $ac_c" 1>&6 -echo "configure:6532: checking for aio_read in -lrt" >&5 +echo "configure:6570: checking for aio_read in -lrt" >&5 ac_lib_var=`echo rt'_'aio_read | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6536,7 +6574,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lrt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6589: \"$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 @@ -6572,7 +6610,7 @@ fi case "$host" in *-pc-sco3.2*) echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6 -echo "configure:6576: checking for strftime in -lintl" >&5 +echo "configure:6614: 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 @@ -6580,7 +6618,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6633: \"$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 @@ -6776,12 +6814,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6780: checking for $ac_func" >&5 +echo "configure:6818: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6829,8 +6867,38 @@ fi done + + +if test "$ac_cv_func_poll" = "yes" ; then + SELECT_TYPE="poll" + cat >> confdefs.h <<\EOF +#define USE_POLL 1 +EOF + +elif test "$ac_cv_func_select" = "yes" ; then + SELECT_TYPE="select" + cat >> confdefs.h <<\EOF +#define USE_SELECT 1 +EOF + +else + echo "Eep! Can't find poll or select!" + echo "I'll try select and hope for the best." + SELECT_TYPE="select" + cat >> confdefs.h <<\EOF +#define USE_SELECT 1 +EOF + +fi +echo "Using ${SELECT_TYPE} for select loop." +cat >> confdefs.h <&6 -echo "configure:6834: checking if setresuid is implemented" >&5 +echo "configure:6902: checking if setresuid is implemented" >&5 if eval "test \"`echo '$''{'ac_cv_func_setresuid'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6838,7 +6906,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -6851,7 +6919,7 @@ else } EOF -if { (eval echo configure:6855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setresuid="yes" else @@ -6897,7 +6965,7 @@ fi if test "$IPF_TRANSPARENT" ; then echo $ac_n "checking if IP-Filter header files are installed""... $ac_c" 1>&6 -echo "configure:6901: checking if IP-Filter header files are installed" >&5 +echo "configure:6969: checking if IP-Filter header files are installed" >&5 # hold on to your hats... if test "$ac_cv_header_ip_compat_h" = "yes" || test "$ac_cv_header_ip_fil_compat_h" = "yes" || @@ -6938,7 +7006,7 @@ fi if test "$LINUX_NETFILTER" ; then echo $ac_n "checking if Linux 2.4 kernel header files are installed""... $ac_c" 1>&6 -echo "configure:6942: checking if Linux 2.4 kernel header files are installed" >&5 +echo "configure:7010: checking if Linux 2.4 kernel header files are installed" >&5 # hold on to your hats... if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then LINUX_NETFILTER="yes" @@ -6972,13 +7040,13 @@ if test -z "$USE_GNUREGEX" ; then esac fi echo $ac_n "checking if GNUregex needs to be compiled""... $ac_c" 1>&6 -echo "configure:6976: checking if GNUregex needs to be compiled" >&5 +echo "configure:7044: checking if GNUregex needs to be compiled" >&5 if test -z "$USE_GNUREGEX"; then if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then USE_GNUREGEX="yes" else cat > conftest.$ac_ext < #include @@ -6986,7 +7054,7 @@ int main() { regex_t t; regcomp(&t,"",0); ; return 0; } EOF -if { (eval echo configure:6990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7058: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* USE_GNUREGEX="no" else @@ -7017,12 +7085,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7021: checking for $ac_func" >&5 +echo "configure:7089: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7073,12 +7141,12 @@ done echo $ac_n "checking Default FD_SETSIZE value""... $ac_c" 1>&6 -echo "configure:7077: checking Default FD_SETSIZE value" >&5 +echo "configure:7145: checking Default FD_SETSIZE value" >&5 if test "$cross_compiling" = yes; then DEFAULT_FD_SETSIZE=256 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:7175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then DEFAULT_FD_SETSIZE=`cat conftestval` else @@ -7122,7 +7190,7 @@ EOF echo $ac_n "checking Maximum number of filedescriptors we can open""... $ac_c" 1>&6 -echo "configure:7126: checking Maximum number of filedescriptors we can open" >&5 +echo "configure:7194: checking Maximum number of filedescriptors we can open" >&5 TLDFLAGS="$LDFLAGS" case $host in i386-unknown-freebsd*) @@ -7134,7 +7202,7 @@ if test "$cross_compiling" = yes; then SQUID_MAXFD=256 else cat > conftest.$ac_ext < @@ -7194,7 +7262,7 @@ main() { } EOF -if { (eval echo configure:7198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then SQUID_MAXFD=`cat conftestval` else @@ -7221,12 +7289,12 @@ fi LDFLAGS="$TLDFLAGS" echo $ac_n "checking Default UDP send buffer size""... $ac_c" 1>&6 -echo "configure:7225: checking Default UDP send buffer size" >&5 +echo "configure:7293: checking Default UDP send buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_UDP_SO_SNDBUF=16384 else cat > conftest.$ac_ext < @@ -7247,7 +7315,7 @@ main () } EOF -if { (eval echo configure:7251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then SQUID_UDP_SO_SNDBUF=`cat conftestval` else @@ -7266,12 +7334,12 @@ EOF echo $ac_n "checking Default UDP receive buffer size""... $ac_c" 1>&6 -echo "configure:7270: checking Default UDP receive buffer size" >&5 +echo "configure:7338: checking Default UDP receive buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_UDP_SO_RCVBUF=16384 else cat > conftest.$ac_ext < @@ -7292,7 +7360,7 @@ main () } EOF -if { (eval echo configure:7296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then SQUID_UDP_SO_RCVBUF=`cat conftestval` else @@ -7311,12 +7379,12 @@ EOF echo $ac_n "checking Default TCP send buffer size""... $ac_c" 1>&6 -echo "configure:7315: checking Default TCP send buffer size" >&5 +echo "configure:7383: checking Default TCP send buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_TCP_SO_SNDBUF=16384 else cat > conftest.$ac_ext < @@ -7337,7 +7405,7 @@ main () } EOF -if { (eval echo configure:7341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then SQUID_TCP_SO_SNDBUF=`cat conftestval` else @@ -7356,12 +7424,12 @@ EOF echo $ac_n "checking Default TCP receive buffer size""... $ac_c" 1>&6 -echo "configure:7360: checking Default TCP receive buffer size" >&5 +echo "configure:7428: checking Default TCP receive buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_TCP_SO_RCVBUF=16384 else cat > conftest.$ac_ext < @@ -7382,7 +7450,7 @@ main () } EOF -if { (eval echo configure:7386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then SQUID_TCP_SO_RCVBUF=`cat conftestval` else @@ -7401,19 +7469,19 @@ EOF echo $ac_n "checking if sys_errlist is already defined""... $ac_c" 1>&6 -echo "configure:7405: checking if sys_errlist is already defined" >&5 +echo "configure:7473: checking if sys_errlist is already defined" >&5 if eval "test \"`echo '$''{'ac_cv_needs_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *s = sys_errlist; ; return 0; } EOF -if { (eval echo configure:7417: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7485: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_needs_sys_errlist="no" else @@ -7435,16 +7503,16 @@ EOF fi echo $ac_n "checking for libresolv _dns_ttl_ hack""... $ac_c" 1>&6 -echo "configure:7439: checking for libresolv _dns_ttl_ hack" >&5 +echo "configure:7507: checking for libresolv _dns_ttl_ hack" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -7460,12 +7528,12 @@ fi rm -f conftest* echo $ac_n "checking if inet_ntoa() actually works""... $ac_c" 1>&6 -echo "configure:7464: checking if inet_ntoa() actually works" >&5 +echo "configure:7532: checking if inet_ntoa() actually works" >&5 if test "$cross_compiling" = yes; then INET_NTOA_RESULT="broken" else cat > conftest.$ac_ext < @@ -7484,7 +7552,7 @@ main () } EOF -if { (eval echo configure:7488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then INET_NTOA_RESULT=`cat conftestval` else @@ -7510,9 +7578,9 @@ fi if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then echo $ac_n "checking for working statvfs() interface""... $ac_c" 1>&6 -echo "configure:7514: checking for working statvfs() interface" >&5 +echo "configure:7582: checking for working statvfs() interface" >&5 cat > conftest.$ac_ext < @@ -7529,7 +7597,7 @@ statvfs("/tmp", &sfs); ; return 0; } EOF -if { (eval echo configure:7533: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_func_statvfs=yes else @@ -7549,12 +7617,12 @@ fi fi echo $ac_n "checking for _res.nsaddr_list""... $ac_c" 1>&6 -echo "configure:7553: checking for _res.nsaddr_list" >&5 +echo "configure:7621: checking for _res.nsaddr_list" >&5 if eval "test \"`echo '$''{'ac_cv_have_res_nsaddr_list'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_res_nsaddr_list="yes" else @@ -7599,12 +7667,12 @@ fi if test $ac_cv_have_res_nsaddr_list = "no" ; then echo $ac_n "checking for _res.ns_list""... $ac_c" 1>&6 -echo "configure:7603: checking for _res.ns_list" >&5 +echo "configure:7671: checking for _res.ns_list" >&5 if eval "test \"`echo '$''{'ac_cv_have_res_ns_list'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7699: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_res_ns_list="yes" else diff --git a/configure.in b/configure.in index 869f3e234c..1c6f1b9eb0 100644 --- a/configure.in +++ b/configure.in @@ -1,9 +1,9 @@ -dnl + dnl Configuration input file for Squid dnl dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9) dnl -dnl $Id: configure.in,v 1.252 2001/12/24 15:02:08 adrian Exp $ +dnl $Id: configure.in,v 1.253 2001/12/24 15:33:41 adrian Exp $ dnl dnl dnl @@ -11,7 +11,7 @@ AC_INIT(src/main.c) AC_CONFIG_AUX_DIR(cfgaux) AM_INIT_AUTOMAKE(squid, 2.6-DEVEL) AM_CONFIG_HEADER(include/autoconf.h) -AC_REVISION($Revision: 1.252 $)dnl +AC_REVISION($Revision: 1.253 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE @@ -658,15 +658,13 @@ AC_ARG_WITH(coss-membuf-size, fi ]) +dnl check for netio plugin stuff dnl Enable poll() AC_ARG_ENABLE(poll, -[ --enable-poll Enable poll() instead of select(). Normally poll - is preferred over select, but configure knows poll - is broken on some platforms. If you think you are - smarter than the configure script, you may enable - poll with this option. - --disable-poll Disable the use of poll().], -[ +[ --enable-poll Enable poll() support. + --disable-poll Disable poll() support. ], + +[ case "$enableval" in yes) echo "Forcing poll() to be enabled" @@ -679,6 +677,42 @@ AC_ARG_ENABLE(poll, esac ]) +dnl Enable select() +AC_ARG_ENABLE(select, +[ --enable-select Enable select() support. + --disable-select Disable select() support. ], + +[ + case "$enableval" in + yes) + echo "Forcing select() to be enabled" + ac_cv_func_select='yes' + ;; + no) + echo "Forcing select() to be disabled" + ac_cv_func_select='no' + ;; + esac +]) + +dnl Enable kqueue() +AC_ARG_ENABLE(kqueue, +[ --enable-kqueue Enable kqueue() support. + --disable-kqueue Disable kqueue() support. ], + +[ + case "$enableval" in + yes) + echo "Forcing kqueue() to be enabled" + ac_cv_func_kqueue='yes' + ;; + no) + echo "Forcing kqueue() to be disabled" + ac_cv_func_kqueue='no' + ;; +esac +]) + dnl Disable HTTP violations AC_ARG_ENABLE(http-violations, [ --disable-http-violations @@ -1566,6 +1600,28 @@ AC_CHECK_FUNCS(\ bswap_32 \ ) +dnl Magic which checks whether we are forcing a type of comm loop we +dnl are actually going to (ab)use + +dnl Actually do the define magic now +dnl mostly ripped from squid-commloops, thanks to adrian and benno + +if test "$ac_cv_func_poll" = "yes" ; then + SELECT_TYPE="poll" + AC_DEFINE(USE_POLL) +elif test "$ac_cv_func_select" = "yes" ; then + SELECT_TYPE="select" + AC_DEFINE(USE_SELECT) +else + echo "Eep! Can't find poll or select!" + echo "I'll try select and hope for the best." + SELECT_TYPE="select" + AC_DEFINE(USE_SELECT) +fi +echo "Using ${SELECT_TYPE} for select loop." +AC_DEFINE_UNQUOTED(SELECT_TYPE, "$SELECT_TYPE") + + dnl Yay! Another Linux brokenness. Its not good enough dnl to know that setresuid() exists, because RedHat 5.0 declares dnl setresuid() but doesn't implement it. diff --git a/include/autoconf.h.in b/include/autoconf.h.in index 04fc138044..1cff7243b6 100644 --- a/include/autoconf.h.in +++ b/include/autoconf.h.in @@ -52,6 +52,15 @@ /* Define to `int' if doesn't define. */ #undef pid_t +/* Define to the type of arg1 for select(). */ +#undef SELECT_TYPE_ARG1 + +/* Define to the type of args 2, 3 and 4 for select(). */ +#undef SELECT_TYPE_ARG234 + +/* Define to the type of arg5 for select(). */ +#undef SELECT_TYPE_ARG5 + /* Define to `unsigned' if doesn't define. */ #undef size_t @@ -384,6 +393,10 @@ */ #undef X_ACCELERATOR_VARY +/* Support for poll/select/etc stuff */ +#undef USE_POLL +#undef USE_SELECT + /* The number of bytes in a __int64. */ #undef SIZEOF___INT64 diff --git a/src/Makefile.am b/src/Makefile.am index b111bf7e18..31e85da4cb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.am,v 1.16 2001/11/30 16:22:35 hno Exp $ +# $Id: Makefile.am,v 1.17 2001/12/24 15:33:42 adrian Exp $ # # Uncomment and customize the following to suit your needs: # @@ -112,6 +112,7 @@ squid_SOURCES = \ client_side.c \ comm.c \ comm_select.c \ + comm_poll.c \ debug.c \ defines.h \ $(DELAY_POOL_SOURCE) \ diff --git a/src/Makefile.in b/src/Makefile.in index 09b7e65bf3..f03f429a21 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -16,7 +16,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.225 2001/11/30 16:30:44 hno Exp $ +# $Id: Makefile.in,v 1.226 2001/12/24 15:33:42 adrian Exp $ # # Uncomment and customize the following to suit your needs: # @@ -213,6 +213,7 @@ squid_SOURCES = \ client_side.c \ comm.c \ comm_select.c \ + comm_poll.c \ debug.c \ defines.h \ $(DELAY_POOL_SOURCE) \ @@ -453,19 +454,19 @@ am_squid_OBJECTS = access_log.$(OBJEXT) acl.$(OBJEXT) asn.$(OBJEXT) \ authenticate.$(OBJEXT) cache_cf.$(OBJEXT) CacheDigest.$(OBJEXT) \ cache_manager.$(OBJEXT) carp.$(OBJEXT) cbdata.$(OBJEXT) \ client_db.$(OBJEXT) client_side.$(OBJEXT) comm.$(OBJEXT) \ - comm_select.$(OBJEXT) debug.$(OBJEXT) $(am__objects_3) \ - disk.$(OBJEXT) $(am__objects_4) errorpage.$(OBJEXT) \ - ETag.$(OBJEXT) event.$(OBJEXT) fd.$(OBJEXT) filemap.$(OBJEXT) \ - forward.$(OBJEXT) fqdncache.$(OBJEXT) ftp.$(OBJEXT) \ - gopher.$(OBJEXT) helper.$(OBJEXT) $(am__objects_5) \ - http.$(OBJEXT) HttpStatusLine.$(OBJEXT) HttpHdrCc.$(OBJEXT) \ - HttpHdrRange.$(OBJEXT) HttpHdrContRange.$(OBJEXT) \ - HttpHeader.$(OBJEXT) HttpHeaderTools.$(OBJEXT) \ - HttpBody.$(OBJEXT) HttpMsg.$(OBJEXT) HttpReply.$(OBJEXT) \ - HttpRequest.$(OBJEXT) icmp.$(OBJEXT) icp_v2.$(OBJEXT) \ - icp_v3.$(OBJEXT) ident.$(OBJEXT) internal.$(OBJEXT) \ - ipc.$(OBJEXT) ipcache.$(OBJEXT) $(am__objects_6) \ - logfile.$(OBJEXT) main.$(OBJEXT) mem.$(OBJEXT) \ + comm_select.$(OBJEXT) comm_poll.$(OBJEXT) debug.$(OBJEXT) \ + $(am__objects_3) disk.$(OBJEXT) $(am__objects_4) \ + errorpage.$(OBJEXT) ETag.$(OBJEXT) event.$(OBJEXT) fd.$(OBJEXT) \ + filemap.$(OBJEXT) forward.$(OBJEXT) fqdncache.$(OBJEXT) \ + ftp.$(OBJEXT) gopher.$(OBJEXT) helper.$(OBJEXT) \ + $(am__objects_5) http.$(OBJEXT) HttpStatusLine.$(OBJEXT) \ + HttpHdrCc.$(OBJEXT) HttpHdrRange.$(OBJEXT) \ + HttpHdrContRange.$(OBJEXT) HttpHeader.$(OBJEXT) \ + HttpHeaderTools.$(OBJEXT) HttpBody.$(OBJEXT) HttpMsg.$(OBJEXT) \ + HttpReply.$(OBJEXT) HttpRequest.$(OBJEXT) icmp.$(OBJEXT) \ + icp_v2.$(OBJEXT) icp_v3.$(OBJEXT) ident.$(OBJEXT) \ + internal.$(OBJEXT) ipc.$(OBJEXT) ipcache.$(OBJEXT) \ + $(am__objects_6) logfile.$(OBJEXT) main.$(OBJEXT) mem.$(OBJEXT) \ MemPool.$(OBJEXT) MemBuf.$(OBJEXT) mime.$(OBJEXT) \ multicast.$(OBJEXT) neighbors.$(OBJEXT) net_db.$(OBJEXT) \ Packer.$(OBJEXT) pconn.$(OBJEXT) peer_digest.$(OBJEXT) \ @@ -517,28 +518,28 @@ depcomp = $(SHELL) $(top_srcdir)/cfgaux/depcomp @AMDEP_TRUE@ $(DEPDIR)/carp.Po $(DEPDIR)/cbdata.Po \ @AMDEP_TRUE@ $(DEPDIR)/cf_gen.Po $(DEPDIR)/client.Po \ @AMDEP_TRUE@ $(DEPDIR)/client_db.Po $(DEPDIR)/client_side.Po \ -@AMDEP_TRUE@ $(DEPDIR)/comm.Po $(DEPDIR)/comm_select.Po \ -@AMDEP_TRUE@ $(DEPDIR)/debug.Po $(DEPDIR)/delay_pools.Po \ -@AMDEP_TRUE@ $(DEPDIR)/disk.Po $(DEPDIR)/dns.Po \ -@AMDEP_TRUE@ $(DEPDIR)/dns_internal.Po $(DEPDIR)/dnsserver.Po \ -@AMDEP_TRUE@ $(DEPDIR)/errorpage.Po $(DEPDIR)/event.Po \ -@AMDEP_TRUE@ $(DEPDIR)/fd.Po $(DEPDIR)/filemap.Po \ -@AMDEP_TRUE@ $(DEPDIR)/forward.Po $(DEPDIR)/fqdncache.Po \ -@AMDEP_TRUE@ $(DEPDIR)/ftp.Po $(DEPDIR)/globals.Po \ -@AMDEP_TRUE@ $(DEPDIR)/gopher.Po $(DEPDIR)/helper.Po \ -@AMDEP_TRUE@ $(DEPDIR)/htcp.Po $(DEPDIR)/http.Po \ -@AMDEP_TRUE@ $(DEPDIR)/icmp.Po $(DEPDIR)/icp_v2.Po \ -@AMDEP_TRUE@ $(DEPDIR)/icp_v3.Po $(DEPDIR)/ident.Po \ -@AMDEP_TRUE@ $(DEPDIR)/internal.Po $(DEPDIR)/ipc.Po \ -@AMDEP_TRUE@ $(DEPDIR)/ipcache.Po $(DEPDIR)/leakfinder.Po \ -@AMDEP_TRUE@ $(DEPDIR)/logfile.Po $(DEPDIR)/main.Po \ -@AMDEP_TRUE@ $(DEPDIR)/mem.Po $(DEPDIR)/mime.Po \ -@AMDEP_TRUE@ $(DEPDIR)/multicast.Po $(DEPDIR)/neighbors.Po \ -@AMDEP_TRUE@ $(DEPDIR)/net_db.Po $(DEPDIR)/pconn.Po \ -@AMDEP_TRUE@ $(DEPDIR)/peer_digest.Po $(DEPDIR)/peer_select.Po \ -@AMDEP_TRUE@ $(DEPDIR)/pinger.Po $(DEPDIR)/redirect.Po \ -@AMDEP_TRUE@ $(DEPDIR)/referer.Po $(DEPDIR)/refresh.Po \ -@AMDEP_TRUE@ $(DEPDIR)/repl_modules.Po \ +@AMDEP_TRUE@ $(DEPDIR)/comm.Po $(DEPDIR)/comm_poll.Po \ +@AMDEP_TRUE@ $(DEPDIR)/comm_select.Po $(DEPDIR)/debug.Po \ +@AMDEP_TRUE@ $(DEPDIR)/delay_pools.Po $(DEPDIR)/disk.Po \ +@AMDEP_TRUE@ $(DEPDIR)/dns.Po $(DEPDIR)/dns_internal.Po \ +@AMDEP_TRUE@ $(DEPDIR)/dnsserver.Po $(DEPDIR)/errorpage.Po \ +@AMDEP_TRUE@ $(DEPDIR)/event.Po $(DEPDIR)/fd.Po \ +@AMDEP_TRUE@ $(DEPDIR)/filemap.Po $(DEPDIR)/forward.Po \ +@AMDEP_TRUE@ $(DEPDIR)/fqdncache.Po $(DEPDIR)/ftp.Po \ +@AMDEP_TRUE@ $(DEPDIR)/globals.Po $(DEPDIR)/gopher.Po \ +@AMDEP_TRUE@ $(DEPDIR)/helper.Po $(DEPDIR)/htcp.Po \ +@AMDEP_TRUE@ $(DEPDIR)/http.Po $(DEPDIR)/icmp.Po \ +@AMDEP_TRUE@ $(DEPDIR)/icp_v2.Po $(DEPDIR)/icp_v3.Po \ +@AMDEP_TRUE@ $(DEPDIR)/ident.Po $(DEPDIR)/internal.Po \ +@AMDEP_TRUE@ $(DEPDIR)/ipc.Po $(DEPDIR)/ipcache.Po \ +@AMDEP_TRUE@ $(DEPDIR)/leakfinder.Po $(DEPDIR)/logfile.Po \ +@AMDEP_TRUE@ $(DEPDIR)/main.Po $(DEPDIR)/mem.Po \ +@AMDEP_TRUE@ $(DEPDIR)/mime.Po $(DEPDIR)/multicast.Po \ +@AMDEP_TRUE@ $(DEPDIR)/neighbors.Po $(DEPDIR)/net_db.Po \ +@AMDEP_TRUE@ $(DEPDIR)/pconn.Po $(DEPDIR)/peer_digest.Po \ +@AMDEP_TRUE@ $(DEPDIR)/peer_select.Po $(DEPDIR)/pinger.Po \ +@AMDEP_TRUE@ $(DEPDIR)/redirect.Po $(DEPDIR)/referer.Po \ +@AMDEP_TRUE@ $(DEPDIR)/refresh.Po $(DEPDIR)/repl_modules.Po \ @AMDEP_TRUE@ $(DEPDIR)/send-announce.Po $(DEPDIR)/snmp_agent.Po \ @AMDEP_TRUE@ $(DEPDIR)/snmp_core.Po $(DEPDIR)/ssl.Po \ @AMDEP_TRUE@ $(DEPDIR)/ssl_support.Po $(DEPDIR)/stat.Po \ @@ -696,6 +697,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/client_db.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/client_side.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/comm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/comm_poll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/comm_select.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/debug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/delay_pools.Po@am__quote@ diff --git a/src/comm.cc b/src/comm.cc index 8fc67ddb81..2247e5cfee 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,6 +1,6 @@ /* - * $Id: comm.cc,v 1.324 2001/10/24 07:45:34 hno Exp $ + * $Id: comm.cc,v 1.325 2001/12/24 15:33:42 adrian Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -683,27 +683,6 @@ commSetDefer(int fd, DEFER * func, void *data) F->defer_data = data; } -void -commSetSelect(int fd, unsigned int type, PF * handler, void *client_data, time_t timeout) -{ - fde *F = &fd_table[fd]; - assert(fd >= 0); - assert(F->flags.open); - debug(5, 5) ("commSetSelect: FD %d type %d\n", fd, type); - if (type & COMM_SELECT_READ) { - F->read_handler = handler; - F->read_data = client_data; - commUpdateReadBits(fd, handler); - } - if (type & COMM_SELECT_WRITE) { - F->write_handler = handler; - F->write_data = client_data; - commUpdateWriteBits(fd, handler); - } - if (timeout) - F->timeout = squid_curtime + timeout; -} - void comm_add_close_handler(int fd, PF * handler, void *data) { @@ -999,3 +978,41 @@ commCloseAllSockets(void) } } } + +void +checkTimeouts(void) +{ + int fd; + fde *F = NULL; + PF *callback; + for (fd = 0; fd <= Biggest_FD; fd++) { + F = &fd_table[fd]; + if (!F->flags.open) + continue; + if (F->timeout == 0) + continue; + if (F->timeout > squid_curtime) + continue; + debug(5, 5) ("checkTimeouts: FD %d Expired\n", fd); + if (F->timeout_handler) { + debug(5, 5) ("checkTimeouts: FD %d: Call timeout handler\n", fd); + callback = F->timeout_handler; + F->timeout_handler = NULL; + callback(fd, F->timeout_data); + } else { + debug(5, 5) ("checkTimeouts: FD %d: Forcing comm_close()\n", fd); + comm_close(fd); + } + } +} + + +int +commDeferRead(int fd) +{ + fde *F = &fd_table[fd]; + if (F->defer_check == NULL) + return 0; + return F->defer_check(fd, F->defer_data); +} + diff --git a/src/comm_poll.cc b/src/comm_poll.cc new file mode 100644 index 0000000000..f4713a0011 --- /dev/null +++ b/src/comm_poll.cc @@ -0,0 +1,619 @@ + +/* + * $Id: comm_poll.cc,v 1.1 2001/12/24 15:33:42 adrian Exp $ + * + * DEBUG: section 5 Socket Functions + * + * SQUID Web Proxy Cache http://www.squid-cache.org/ + * ---------------------------------------------------------- + * + * Squid is the result of efforts by numerous individuals from + * the Internet community; see the CONTRIBUTORS file for full + * details. Many organizations have provided support for Squid's + * development; see the SPONSORS file for full details. Squid is + * Copyrighted (C) 2001 by the Regents of the University of + * California; see the COPYRIGHT file for full details. Squid + * incorporates software developed and/or copyrighted by other + * sources; see the CREDITS file for full details. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. + * + */ + +#include "squid.h" + +#ifdef USE_POLL + +static int MAX_POLL_TIME = 1000; /* see also comm_quick_poll_required() */ + +#ifndef howmany +#define howmany(x, y) (((x)+((y)-1))/(y)) +#endif +#ifndef NBBY +#define NBBY 8 +#endif +#define FD_MASK_BYTES sizeof(fd_mask) +#define FD_MASK_BITS (FD_MASK_BYTES*NBBY) + +/* STATIC */ +static int fdIsHttp(int fd); +static int fdIsIcp(int fd); +static int fdIsDns(int fd); +static OBJH commIncomingStats; +static int comm_check_incoming_poll_handlers(int nfds, int *fds); +static void comm_poll_dns_incoming(void); +static void commUpdateReadBits(int fd, PF * handler); +static void commUpdateWriteBits(int fd, PF * handler); + +static fd_set global_readfds; +static fd_set global_writefds; +static int nreadfds; +static int nwritefds; + +/* + * Automatic tuning for incoming requests: + * + * INCOMING sockets are the ICP and HTTP ports. We need to check these + * fairly regularly, but how often? When the load increases, we + * want to check the incoming sockets more often. If we have a lot + * of incoming ICP, then we need to check these sockets more than + * if we just have HTTP. + * + * The variables 'incoming_icp_interval' and 'incoming_http_interval' + * determine how many normal I/O events to process before checking + * incoming sockets again. Note we store the incoming_interval + * multipled by a factor of (2^INCOMING_FACTOR) to have some + * pseudo-floating point precision. + * + * The variable 'icp_io_events' and 'http_io_events' counts how many normal + * I/O events have been processed since the last check on the incoming + * sockets. When io_events > incoming_interval, its time to check incoming + * sockets. + * + * Every time we check incoming sockets, we count how many new messages + * or connections were processed. This is used to adjust the + * incoming_interval for the next iteration. The new incoming_interval + * is calculated as the current incoming_interval plus what we would + * like to see as an average number of events minus the number of + * events just processed. + * + * incoming_interval = incoming_interval + target_average - number_of_events_processed + * + * There are separate incoming_interval counters for both HTTP and ICP events + * + * You can see the current values of the incoming_interval's, as well as + * a histogram of 'incoming_events' by asking the cache manager + * for 'comm_incoming', e.g.: + * + * % ./client mgr:comm_incoming + * + * Caveats: + * + * - We have MAX_INCOMING_INTEGER as a magic upper limit on + * incoming_interval for both types of sockets. At the + * largest value the cache will effectively be idling. + * + * - The higher the INCOMING_FACTOR, the slower the algorithm will + * respond to load spikes/increases/decreases in demand. A value + * between 3 and 8 is recommended. + */ + +#define MAX_INCOMING_INTEGER 256 +#define INCOMING_FACTOR 5 +#define MAX_INCOMING_INTERVAL (MAX_INCOMING_INTEGER << INCOMING_FACTOR) +static int icp_io_events = 0; +static int dns_io_events = 0; +static int http_io_events = 0; +static int incoming_icp_interval = 16 << INCOMING_FACTOR; +static int incoming_dns_interval = 16 << INCOMING_FACTOR; +static int incoming_http_interval = 16 << INCOMING_FACTOR; +#define commCheckICPIncoming (++icp_io_events > (incoming_icp_interval>> INCOMING_FACTOR)) +#define commCheckDNSIncoming (++dns_io_events > (incoming_dns_interval>> INCOMING_FACTOR)) +#define commCheckHTTPIncoming (++http_io_events > (incoming_http_interval>> INCOMING_FACTOR)) + + +void +commSetSelect(int fd, unsigned int type, PF * handler, void *client_data, + time_t timeout) +{ + fde *F = &fd_table[fd]; + assert(fd >= 0); + assert(F->flags.open); + debug(5, 5) ("commSetSelect: FD %d type %d\n", fd, type); + if (type & COMM_SELECT_READ) { + F->read_handler = handler; + F->read_data = client_data; + commUpdateReadBits(fd, handler); + } + if (type & COMM_SELECT_WRITE) { + F->write_handler = handler; + F->write_data = client_data; + commUpdateWriteBits(fd, handler); + } + if (timeout) + F->timeout = squid_curtime + timeout; +} + +static int +fdIsIcp(int fd) +{ + if (fd == theInIcpConnection) + return 1; + if (fd == theOutIcpConnection) + return 1; + return 0; +} + +static int +fdIsDns(int fd) +{ + if (fd == DnsSocket) + return 1; + return 0; +} + +static int +fdIsHttp(int fd) +{ + int j; + for (j = 0; j < NHttpSockets; j++) { + if (fd == HttpSockets[j]) + return 1; + } + return 0; +} + +#if DELAY_POOLS +static int slowfdcnt = 0; +static int slowfdarr[SQUID_MAXFD]; + +static void +commAddSlowFd(int fd) +{ + assert(slowfdcnt < SQUID_MAXFD); + slowfdarr[slowfdcnt++] = fd; +} + +static int +commGetSlowFd(void) +{ + int whichfd, retfd; + + if (!slowfdcnt) + return -1; + whichfd = squid_random() % slowfdcnt; + retfd = slowfdarr[whichfd]; + slowfdarr[whichfd] = slowfdarr[--slowfdcnt]; + return retfd; +} +#endif + +static int +comm_check_incoming_poll_handlers(int nfds, int *fds) +{ + int i; + int fd; + PF *hdl = NULL; + int npfds; + struct pollfd pfds[3 + MAXHTTPPORTS]; + incoming_sockets_accepted = 0; + for (i = npfds = 0; i < nfds; i++) { + int events; + fd = fds[i]; + events = 0; + if (fd_table[fd].read_handler) + events |= POLLRDNORM; + if (fd_table[fd].write_handler) + events |= POLLWRNORM; + if (events) { + pfds[npfds].fd = fd; + pfds[npfds].events = events; + pfds[npfds].revents = 0; + npfds++; + } + } + if (!nfds) + return -1; +#if !ALARM_UPDATES_TIME + getCurrentTime(); +#endif + statCounter.syscalls.polls++; + if (poll(pfds, npfds, 0) < 1) + return incoming_sockets_accepted; + for (i = 0; i < npfds; i++) { + int revents; + if (((revents = pfds[i].revents) == 0) || ((fd = pfds[i].fd) == -1)) + continue; + if (revents & (POLLRDNORM | POLLIN | POLLHUP | POLLERR)) { + if ((hdl = fd_table[fd].read_handler)) { + fd_table[fd].read_handler = NULL; + hdl(fd, fd_table[fd].read_data); + } else if (pfds[i].events & POLLRDNORM) + debug(5, 1) ("comm_poll_incoming: FD %d NULL read handler\n", + fd); + } + if (revents & (POLLWRNORM | POLLOUT | POLLHUP | POLLERR)) { + if ((hdl = fd_table[fd].write_handler)) { + fd_table[fd].write_handler = NULL; + hdl(fd, fd_table[fd].write_data); + } else if (pfds[i].events & POLLWRNORM) + debug(5, 1) ("comm_poll_incoming: FD %d NULL write_handler\n", + fd); + } + } + return incoming_sockets_accepted; +} + +static void +comm_poll_icp_incoming(void) +{ + int nfds = 0; + int fds[2]; + int nevents; + icp_io_events = 0; + if (theInIcpConnection >= 0) + fds[nfds++] = theInIcpConnection; + if (theInIcpConnection != theOutIcpConnection) + if (theOutIcpConnection >= 0) + fds[nfds++] = theOutIcpConnection; + if (nfds == 0) + return; + nevents = comm_check_incoming_poll_handlers(nfds, fds); + incoming_icp_interval += Config.comm_incoming.icp_average - nevents; + if (incoming_icp_interval < Config.comm_incoming.icp_min_poll) + incoming_icp_interval = Config.comm_incoming.icp_min_poll; + if (incoming_icp_interval > MAX_INCOMING_INTERVAL) + incoming_icp_interval = MAX_INCOMING_INTERVAL; + if (nevents > INCOMING_ICP_MAX) + nevents = INCOMING_ICP_MAX; + statHistCount(&statCounter.comm_icp_incoming, nevents); +} + +static void +comm_poll_http_incoming(void) +{ + int nfds = 0; + int fds[MAXHTTPPORTS]; + int j; + int nevents; + http_io_events = 0; + for (j = 0; j < NHttpSockets; j++) { + if (HttpSockets[j] < 0) + continue; + if (commDeferRead(HttpSockets[j])) + continue; + fds[nfds++] = HttpSockets[j]; + } + nevents = comm_check_incoming_poll_handlers(nfds, fds); + incoming_http_interval = incoming_http_interval + + Config.comm_incoming.http_average - nevents; + if (incoming_http_interval < Config.comm_incoming.http_min_poll) + incoming_http_interval = Config.comm_incoming.http_min_poll; + if (incoming_http_interval > MAX_INCOMING_INTERVAL) + incoming_http_interval = MAX_INCOMING_INTERVAL; + if (nevents > INCOMING_HTTP_MAX) + nevents = INCOMING_HTTP_MAX; + statHistCount(&statCounter.comm_http_incoming, nevents); +} + +/* poll all sockets; call handlers for those that are ready. */ +int +comm_select(int msec) +{ + struct pollfd pfds[SQUID_MAXFD]; +#if DELAY_POOLS + fd_set slowfds; +#endif + PF *hdl = NULL; + int fd; + int i; + int maxfd; + unsigned long nfds; + unsigned long npending; + int num; + int callicp = 0, callhttp = 0; + int calldns = 0; + static time_t last_timeout = 0; + double timeout = current_dtime + (msec / 1000.0); + do { +#if !ALARM_UPDATES_TIME + double start; + getCurrentTime(); + start = current_dtime; +#endif + /* Handle any fs callbacks that need doing */ + storeDirCallback(); +#if DELAY_POOLS + FD_ZERO(&slowfds); +#endif + if (commCheckICPIncoming) + comm_poll_icp_incoming(); + if (commCheckDNSIncoming) + comm_poll_dns_incoming(); + if (commCheckHTTPIncoming) + comm_poll_http_incoming(); + callicp = calldns = callhttp = 0; + nfds = 0; + npending = 0; + maxfd = Biggest_FD + 1; + for (i = 0; i < maxfd; i++) { + int events; + events = 0; + /* Check each open socket for a handler. */ + if (fd_table[i].read_handler) { + switch (commDeferRead(i)) { + case 0: + events |= POLLRDNORM; + break; + case 1: + break; +#if DELAY_POOLS + case -1: + events |= POLLRDNORM; + FD_SET(i, &slowfds); + break; +#endif + default: + fatalf("bad return value from commDeferRead(FD %d)\n", i); + } + } + if (fd_table[i].write_handler) + events |= POLLWRNORM; + if (events) { + pfds[nfds].fd = i; + pfds[nfds].events = events; + pfds[nfds].revents = 0; + nfds++; + if ((events & POLLRDNORM) && fd_table[i].flags.read_pending) + npending++; + } + } + if (nfds == 0) { + assert(shutting_down); + return COMM_SHUTDOWN; + } + if (npending) + msec = 0; + if (msec > MAX_POLL_TIME) + msec = MAX_POLL_TIME; + for (;;) { + statCounter.syscalls.polls++; + num = poll(pfds, nfds, msec); + statCounter.select_loops++; + if (num >= 0 || npending >= 0) + break; + if (ignoreErrno(errno)) + continue; + debug(5, 0) ("comm_poll: poll failure: %s\n", xstrerror()); + assert(errno != EINVAL); + return COMM_ERROR; + /* NOTREACHED */ + } + debug(5, num ? 5 : 8) ("comm_poll: %d+%ld FDs ready\n", num, npending); + statHistCount(&statCounter.select_fds_hist, num); + /* Check timeout handlers ONCE each second. */ + if (squid_curtime > last_timeout) { + last_timeout = squid_curtime; + checkTimeouts(); + } + if (num == 0 && npending == 0) + continue; + /* scan each socket but the accept socket. Poll this + * more frequently to minimize losses due to the 5 connect + * limit in SunOS */ + for (i = 0; i < nfds; i++) { + fde *F; + int revents = pfds[i].revents; + fd = pfds[i].fd; + if (fd == -1) + continue; + if (fd_table[fd].flags.read_pending) + revents |= POLLIN; + if (revents == 0) + continue; + if (fdIsIcp(fd)) { + callicp = 1; + continue; + } + if (fdIsDns(fd)) { + calldns = 1; + continue; + } + if (fdIsHttp(fd)) { + callhttp = 1; + continue; + } + F = &fd_table[fd]; + if (revents & (POLLRDNORM | POLLIN | POLLHUP | POLLERR)) { + debug(5, 6) ("comm_poll: FD %d ready for reading\n", fd); + if (NULL == (hdl = F->read_handler)) + (void) 0; +#if DELAY_POOLS + else if (FD_ISSET(fd, &slowfds)) + commAddSlowFd(fd); +#endif + else { + F->read_handler = NULL; + hdl(fd, F->read_data); + statCounter.select_fds++; + if (commCheckICPIncoming) + comm_poll_icp_incoming(); + if (commCheckDNSIncoming) + comm_poll_dns_incoming(); + if (commCheckHTTPIncoming) + comm_poll_http_incoming(); + } + } + if (revents & (POLLWRNORM | POLLOUT | POLLHUP | POLLERR)) { + debug(5, 5) ("comm_poll: FD %d ready for writing\n", fd); + if ((hdl = F->write_handler)) { + F->write_handler = NULL; + hdl(fd, F->write_data); + statCounter.select_fds++; + if (commCheckICPIncoming) + comm_poll_icp_incoming(); + if (commCheckDNSIncoming) + comm_poll_dns_incoming(); + if (commCheckHTTPIncoming) + comm_poll_http_incoming(); + } + } + if (revents & POLLNVAL) { + close_handler *ch; + debug(5, 0) ("WARNING: FD %d has handlers, but it's invalid.\n", fd); + debug(5, 0) ("FD %d is a %s\n", fd, fdTypeStr[F->type]); + debug(5, 0) ("--> %s\n", F->desc); + debug(5, 0) ("tmout:%p read:%p write:%p\n", + F->timeout_handler, + F->read_handler, + F->write_handler); + for (ch = F->close_handler; ch; ch = ch->next) + debug(5, 0) (" close handler: %p\n", ch->handler); + if (F->close_handler) { + commCallCloseHandlers(fd); + } else if (F->timeout_handler) { + debug(5, 0) ("comm_poll: Calling Timeout Handler\n"); + F->timeout_handler(fd, F->timeout_data); + } + F->close_handler = NULL; + F->timeout_handler = NULL; + F->read_handler = NULL; + F->write_handler = NULL; + if (F->flags.open) + fd_close(fd); + } + } + if (callicp) + comm_poll_icp_incoming(); + if (calldns) + comm_poll_dns_incoming(); + if (callhttp) + comm_poll_http_incoming(); +#if DELAY_POOLS + while ((fd = commGetSlowFd()) != -1) { + fde *F = &fd_table[fd]; + debug(5, 6) ("comm_select: slow FD %d selected for reading\n", fd); + if ((hdl = F->read_handler)) { + F->read_handler = NULL; + hdl(fd, F->read_data); + statCounter.select_fds++; + if (commCheckICPIncoming) + comm_poll_icp_incoming(); + if (commCheckDNSIncoming) + comm_poll_dns_incoming(); + if (commCheckHTTPIncoming) + comm_poll_http_incoming(); + } + } +#endif +#if !ALARM_UPDATES_TIME + getCurrentTime(); + statCounter.select_time += (current_dtime - start); +#endif + return COMM_OK; + } + while (timeout > current_dtime); + debug(5, 8) ("comm_poll: time out: %ld.\n", (long int) squid_curtime); + return COMM_TIMEOUT; +} + + +static void +comm_poll_dns_incoming(void) +{ + int nfds = 0; + int fds[2]; + int nevents; + dns_io_events = 0; + if (DnsSocket < 0) + return; + fds[nfds++] = DnsSocket; + nevents = comm_check_incoming_poll_handlers(nfds, fds); + if (nevents < 0) + return; + incoming_dns_interval += Config.comm_incoming.dns_average - nevents; + if (incoming_dns_interval < Config.comm_incoming.dns_min_poll) + incoming_dns_interval = Config.comm_incoming.dns_min_poll; + if (incoming_dns_interval > MAX_INCOMING_INTERVAL) + incoming_dns_interval = MAX_INCOMING_INTERVAL; + if (nevents > INCOMING_DNS_MAX) + nevents = INCOMING_DNS_MAX; + statHistCount(&statCounter.comm_dns_incoming, nevents); +} + +void +comm_select_init(void) +{ + cachemgrRegister("comm_incoming", + "comm_incoming() stats", + commIncomingStats, 0, 1); + FD_ZERO(&global_readfds); + FD_ZERO(&global_writefds); + nreadfds = nwritefds = 0; +} + + +static void +commIncomingStats(StoreEntry * sentry) +{ + StatCounters *f = &statCounter; + storeAppendPrintf(sentry, "Current incoming_icp_interval: %d\n", + incoming_icp_interval >> INCOMING_FACTOR); + storeAppendPrintf(sentry, "Current incoming_dns_interval: %d\n", + incoming_dns_interval >> INCOMING_FACTOR); + storeAppendPrintf(sentry, "Current incoming_http_interval: %d\n", + incoming_http_interval >> INCOMING_FACTOR); + storeAppendPrintf(sentry, "\n"); + storeAppendPrintf(sentry, "Histogram of events per incoming socket type\n"); + storeAppendPrintf(sentry, "ICP Messages handled per comm_poll_icp_incoming() call:\n"); + statHistDump(&f->comm_icp_incoming, sentry, statHistIntDumper); + storeAppendPrintf(sentry, "DNS Messages handled per comm_poll_dns_incoming() call:\n"); + statHistDump(&f->comm_dns_incoming, sentry, statHistIntDumper); + storeAppendPrintf(sentry, "HTTP Messages handled per comm_poll_http_incoming() call:\n"); + statHistDump(&f->comm_http_incoming, sentry, statHistIntDumper); +} + +void +commUpdateReadBits(int fd, PF * handler) +{ + if (handler && !FD_ISSET(fd, &global_readfds)) { + FD_SET(fd, &global_readfds); + nreadfds++; + } else if (!handler && FD_ISSET(fd, &global_readfds)) { + FD_CLR(fd, &global_readfds); + nreadfds--; + } +} + +void +commUpdateWriteBits(int fd, PF * handler) +{ + if (handler && !FD_ISSET(fd, &global_writefds)) { + FD_SET(fd, &global_writefds); + nwritefds++; + } else if (!handler && FD_ISSET(fd, &global_writefds)) { + FD_CLR(fd, &global_writefds); + nwritefds--; + } +} + +/* Called by async-io or diskd to speed up the polling */ +void +comm_quick_poll_required(void) +{ + MAX_POLL_TIME = 10; +} + +#endif /* USE_POLL */ diff --git a/src/comm_select.cc b/src/comm_select.cc index d21884eaa6..447d8f97fc 100644 --- a/src/comm_select.cc +++ b/src/comm_select.cc @@ -1,6 +1,6 @@ /* - * $Id: comm_select.cc,v 1.53 2001/10/24 06:55:44 hno Exp $ + * $Id: comm_select.cc,v 1.54 2001/12/24 15:33:42 adrian Exp $ * * DEBUG: section 5 Socket Functions * @@ -34,6 +34,8 @@ #include "squid.h" +#ifdef USE_SELECT + static int MAX_POLL_TIME = 1000; /* see also comm_quick_poll_required() */ #ifndef howmany @@ -46,26 +48,18 @@ static int MAX_POLL_TIME = 1000; /* see also comm_quick_poll_required() */ #define FD_MASK_BITS (FD_MASK_BYTES*NBBY) /* STATIC */ -#if !HAVE_POLL static int examine_select(fd_set *, fd_set *); -#endif static int fdIsHttp(int fd); static int fdIsIcp(int fd); static int fdIsDns(int fd); -static int commDeferRead(int fd); -static void checkTimeouts(void); static OBJH commIncomingStats; -#if HAVE_POLL -static int comm_check_incoming_poll_handlers(int nfds, int *fds); -static void comm_poll_dns_incoming(void); -#else static int comm_check_incoming_select_handlers(int nfds, int *fds); static void comm_select_dns_incoming(void); -#endif +static void commUpdateReadBits(int fd, PF * handler); +static void commUpdateWriteBits(int fd, PF * handler); + -#if !HAVE_POLL static struct timeval zero_tv; -#endif static fd_set global_readfds; static fd_set global_writefds; static int nreadfds; @@ -132,15 +126,29 @@ static int incoming_http_interval = 16 << INCOMING_FACTOR; #define commCheckDNSIncoming (++dns_io_events > (incoming_dns_interval>> INCOMING_FACTOR)) #define commCheckHTTPIncoming (++http_io_events > (incoming_http_interval>> INCOMING_FACTOR)) -static int -commDeferRead(int fd) +void +commSetSelect(int fd, unsigned int type, PF * handler, void *client_data, + time_t timeout) { fde *F = &fd_table[fd]; - if (F->defer_check == NULL) - return 0; - return F->defer_check(fd, F->defer_data); + assert(fd >= 0); + assert(F->flags.open); + debug(5, 5) ("commSetSelect: FD %d type %d\n", fd, type); + if (type & COMM_SELECT_READ) { + F->read_handler = handler; + F->read_data = client_data; + commUpdateReadBits(fd, handler); + } + if (type & COMM_SELECT_WRITE) { + F->write_handler = handler; + F->write_data = client_data; + commUpdateWriteBits(fd, handler); + } + if (timeout) + F->timeout = squid_curtime + timeout; } + static int fdIsIcp(int fd) { @@ -195,337 +203,6 @@ commGetSlowFd(void) } #endif -#if HAVE_POLL -static int -comm_check_incoming_poll_handlers(int nfds, int *fds) -{ - int i; - int fd; - PF *hdl = NULL; - int npfds; - struct pollfd pfds[3 + MAXHTTPPORTS]; - incoming_sockets_accepted = 0; - for (i = npfds = 0; i < nfds; i++) { - int events; - fd = fds[i]; - events = 0; - if (fd_table[fd].read_handler) - events |= POLLRDNORM; - if (fd_table[fd].write_handler) - events |= POLLWRNORM; - if (events) { - pfds[npfds].fd = fd; - pfds[npfds].events = events; - pfds[npfds].revents = 0; - npfds++; - } - } - if (!nfds) - return -1; -#if !ALARM_UPDATES_TIME - getCurrentTime(); -#endif - statCounter.syscalls.polls++; - if (poll(pfds, npfds, 0) < 1) - return incoming_sockets_accepted; - for (i = 0; i < npfds; i++) { - int revents; - if (((revents = pfds[i].revents) == 0) || ((fd = pfds[i].fd) == -1)) - continue; - if (revents & (POLLRDNORM | POLLIN | POLLHUP | POLLERR)) { - if ((hdl = fd_table[fd].read_handler)) { - fd_table[fd].read_handler = NULL; - hdl(fd, fd_table[fd].read_data); - } else if (pfds[i].events & POLLRDNORM) - debug(5, 1) ("comm_poll_incoming: FD %d NULL read handler\n", - fd); - } - if (revents & (POLLWRNORM | POLLOUT | POLLHUP | POLLERR)) { - if ((hdl = fd_table[fd].write_handler)) { - fd_table[fd].write_handler = NULL; - hdl(fd, fd_table[fd].write_data); - } else if (pfds[i].events & POLLWRNORM) - debug(5, 1) ("comm_poll_incoming: FD %d NULL write_handler\n", - fd); - } - } - return incoming_sockets_accepted; -} - -static void -comm_poll_icp_incoming(void) -{ - int nfds = 0; - int fds[2]; - int nevents; - icp_io_events = 0; - if (theInIcpConnection >= 0) - fds[nfds++] = theInIcpConnection; - if (theInIcpConnection != theOutIcpConnection) - if (theOutIcpConnection >= 0) - fds[nfds++] = theOutIcpConnection; - if (nfds == 0) - return; - nevents = comm_check_incoming_poll_handlers(nfds, fds); - incoming_icp_interval += Config.comm_incoming.icp_average - nevents; - if (incoming_icp_interval < Config.comm_incoming.icp_min_poll) - incoming_icp_interval = Config.comm_incoming.icp_min_poll; - if (incoming_icp_interval > MAX_INCOMING_INTERVAL) - incoming_icp_interval = MAX_INCOMING_INTERVAL; - if (nevents > INCOMING_ICP_MAX) - nevents = INCOMING_ICP_MAX; - statHistCount(&statCounter.comm_icp_incoming, nevents); -} - -static void -comm_poll_http_incoming(void) -{ - int nfds = 0; - int fds[MAXHTTPPORTS]; - int j; - int nevents; - http_io_events = 0; - for (j = 0; j < NHttpSockets; j++) { - if (HttpSockets[j] < 0) - continue; - if (commDeferRead(HttpSockets[j])) - continue; - fds[nfds++] = HttpSockets[j]; - } - nevents = comm_check_incoming_poll_handlers(nfds, fds); - incoming_http_interval = incoming_http_interval - + Config.comm_incoming.http_average - nevents; - if (incoming_http_interval < Config.comm_incoming.http_min_poll) - incoming_http_interval = Config.comm_incoming.http_min_poll; - if (incoming_http_interval > MAX_INCOMING_INTERVAL) - incoming_http_interval = MAX_INCOMING_INTERVAL; - if (nevents > INCOMING_HTTP_MAX) - nevents = INCOMING_HTTP_MAX; - statHistCount(&statCounter.comm_http_incoming, nevents); -} - -/* poll all sockets; call handlers for those that are ready. */ -int -comm_poll(int msec) -{ - struct pollfd pfds[SQUID_MAXFD]; -#if DELAY_POOLS - fd_set slowfds; -#endif - PF *hdl = NULL; - int fd; - int i; - int maxfd; - unsigned long nfds; - unsigned long npending; - int num; - int callicp = 0, callhttp = 0; - int calldns = 0; - static time_t last_timeout = 0; - double timeout = current_dtime + (msec / 1000.0); - do { -#if !ALARM_UPDATES_TIME - double start; - getCurrentTime(); - start = current_dtime; -#endif - /* Handle any fs callbacks that need doing */ - storeDirCallback(); -#if DELAY_POOLS - FD_ZERO(&slowfds); -#endif - if (commCheckICPIncoming) - comm_poll_icp_incoming(); - if (commCheckDNSIncoming) - comm_poll_dns_incoming(); - if (commCheckHTTPIncoming) - comm_poll_http_incoming(); - callicp = calldns = callhttp = 0; - nfds = 0; - npending = 0; - maxfd = Biggest_FD + 1; - for (i = 0; i < maxfd; i++) { - int events; - events = 0; - /* Check each open socket for a handler. */ - if (fd_table[i].read_handler) { - switch (commDeferRead(i)) { - case 0: - events |= POLLRDNORM; - break; - case 1: - break; -#if DELAY_POOLS - case -1: - events |= POLLRDNORM; - FD_SET(i, &slowfds); - break; -#endif - default: - fatalf("bad return value from commDeferRead(FD %d)\n", i); - } - } - if (fd_table[i].write_handler) - events |= POLLWRNORM; - if (events) { - pfds[nfds].fd = i; - pfds[nfds].events = events; - pfds[nfds].revents = 0; - nfds++; - if ((events & POLLRDNORM) && fd_table[i].flags.read_pending) - npending++; - } - } - if (nfds == 0) { - assert(shutting_down); - return COMM_SHUTDOWN; - } - if (npending) - msec = 0; - if (msec > MAX_POLL_TIME) - msec = MAX_POLL_TIME; - for (;;) { - statCounter.syscalls.polls++; - num = poll(pfds, nfds, msec); - statCounter.select_loops++; - if (num >= 0 || npending >= 0) - break; - if (ignoreErrno(errno)) - continue; - debug(5, 0) ("comm_poll: poll failure: %s\n", xstrerror()); - assert(errno != EINVAL); - return COMM_ERROR; - /* NOTREACHED */ - } - debug(5, num ? 5 : 8) ("comm_poll: %d+%ld FDs ready\n", num, npending); - statHistCount(&statCounter.select_fds_hist, num); - /* Check timeout handlers ONCE each second. */ - if (squid_curtime > last_timeout) { - last_timeout = squid_curtime; - checkTimeouts(); - } - if (num == 0 && npending == 0) - continue; - /* scan each socket but the accept socket. Poll this - * more frequently to minimize losses due to the 5 connect - * limit in SunOS */ - for (i = 0; i < nfds; i++) { - fde *F; - int revents = pfds[i].revents; - fd = pfds[i].fd; - if (fd == -1) - continue; - if (fd_table[fd].flags.read_pending) - revents |= POLLIN; - if (revents == 0) - continue; - if (fdIsIcp(fd)) { - callicp = 1; - continue; - } - if (fdIsDns(fd)) { - calldns = 1; - continue; - } - if (fdIsHttp(fd)) { - callhttp = 1; - continue; - } - F = &fd_table[fd]; - if (revents & (POLLRDNORM | POLLIN | POLLHUP | POLLERR)) { - debug(5, 6) ("comm_poll: FD %d ready for reading\n", fd); - if (NULL == (hdl = F->read_handler)) - (void) 0; -#if DELAY_POOLS - else if (FD_ISSET(fd, &slowfds)) - commAddSlowFd(fd); -#endif - else { - F->read_handler = NULL; - hdl(fd, F->read_data); - statCounter.select_fds++; - if (commCheckICPIncoming) - comm_poll_icp_incoming(); - if (commCheckDNSIncoming) - comm_poll_dns_incoming(); - if (commCheckHTTPIncoming) - comm_poll_http_incoming(); - } - } - if (revents & (POLLWRNORM | POLLOUT | POLLHUP | POLLERR)) { - debug(5, 5) ("comm_poll: FD %d ready for writing\n", fd); - if ((hdl = F->write_handler)) { - F->write_handler = NULL; - hdl(fd, F->write_data); - statCounter.select_fds++; - if (commCheckICPIncoming) - comm_poll_icp_incoming(); - if (commCheckDNSIncoming) - comm_poll_dns_incoming(); - if (commCheckHTTPIncoming) - comm_poll_http_incoming(); - } - } - if (revents & POLLNVAL) { - close_handler *ch; - debug(5, 0) ("WARNING: FD %d has handlers, but it's invalid.\n", fd); - debug(5, 0) ("FD %d is a %s\n", fd, fdTypeStr[F->type]); - debug(5, 0) ("--> %s\n", F->desc); - debug(5, 0) ("tmout:%p read:%p write:%p\n", - F->timeout_handler, - F->read_handler, - F->write_handler); - for (ch = F->close_handler; ch; ch = ch->next) - debug(5, 0) (" close handler: %p\n", ch->handler); - if (F->close_handler) { - commCallCloseHandlers(fd); - } else if (F->timeout_handler) { - debug(5, 0) ("comm_poll: Calling Timeout Handler\n"); - F->timeout_handler(fd, F->timeout_data); - } - F->close_handler = NULL; - F->timeout_handler = NULL; - F->read_handler = NULL; - F->write_handler = NULL; - if (F->flags.open) - fd_close(fd); - } - } - if (callicp) - comm_poll_icp_incoming(); - if (calldns) - comm_poll_dns_incoming(); - if (callhttp) - comm_poll_http_incoming(); -#if DELAY_POOLS - while ((fd = commGetSlowFd()) != -1) { - fde *F = &fd_table[fd]; - debug(5, 6) ("comm_select: slow FD %d selected for reading\n", fd); - if ((hdl = F->read_handler)) { - F->read_handler = NULL; - hdl(fd, F->read_data); - statCounter.select_fds++; - if (commCheckICPIncoming) - comm_poll_icp_incoming(); - if (commCheckDNSIncoming) - comm_poll_dns_incoming(); - if (commCheckHTTPIncoming) - comm_poll_http_incoming(); - } - } -#endif -#if !ALARM_UPDATES_TIME - getCurrentTime(); - statCounter.select_time += (current_dtime - start); -#endif - return COMM_OK; - } - while (timeout > current_dtime); - debug(5, 8) ("comm_poll: time out: %ld.\n", (long int) squid_curtime); - return COMM_TIMEOUT; -} - -#else static int comm_check_incoming_select_handlers(int nfds, int *fds) @@ -904,14 +581,9 @@ comm_select(int msec) debug(5, 8) ("comm_select: time out: %d\n", (int) squid_curtime); return COMM_TIMEOUT; } -#endif static void -#if HAVE_POLL -comm_poll_dns_incoming(void) -#else comm_select_dns_incoming(void) -#endif { int nfds = 0; int fds[2]; @@ -920,11 +592,7 @@ comm_select_dns_incoming(void) if (DnsSocket < 0) return; fds[nfds++] = DnsSocket; -#if HAVE_POLL - nevents = comm_check_incoming_poll_handlers(nfds, fds); -#else nevents = comm_check_incoming_select_handlers(nfds, fds); -#endif if (nevents < 0) return; incoming_dns_interval += Config.comm_incoming.dns_average - nevents; @@ -940,10 +608,8 @@ comm_select_dns_incoming(void) void comm_select_init(void) { -#if !HAVE_POLL zero_tv.tv_sec = 0; zero_tv.tv_usec = 0; -#endif cachemgrRegister("comm_incoming", "comm_incoming() stats", commIncomingStats, 0, 1); @@ -952,7 +618,6 @@ comm_select_init(void) nreadfds = nwritefds = 0; } -#if !HAVE_POLL /* * examine_select - debug routine. * @@ -1018,34 +683,7 @@ examine_select(fd_set * readfds, fd_set * writefds) } return 0; } -#endif -static void -checkTimeouts(void) -{ - int fd; - fde *F = NULL; - PF *callback; - for (fd = 0; fd <= Biggest_FD; fd++) { - F = &fd_table[fd]; - if (!F->flags.open) - continue; - if (F->timeout == 0) - continue; - if (F->timeout > squid_curtime) - continue; - debug(5, 5) ("checkTimeouts: FD %d Expired\n", fd); - if (F->timeout_handler) { - debug(5, 5) ("checkTimeouts: FD %d: Call timeout handler\n", fd); - callback = F->timeout_handler; - F->timeout_handler = NULL; - callback(fd, F->timeout_data); - } else { - debug(5, 5) ("checkTimeouts: FD %d: Forcing comm_close()\n", fd); - comm_close(fd); - } - } -} static void commIncomingStats(StoreEntry * sentry) @@ -1059,23 +697,11 @@ commIncomingStats(StoreEntry * sentry) incoming_http_interval >> INCOMING_FACTOR); storeAppendPrintf(sentry, "\n"); storeAppendPrintf(sentry, "Histogram of events per incoming socket type\n"); -#ifdef HAVE_POLL - storeAppendPrintf(sentry, "ICP Messages handled per comm_poll_icp_incoming() call:\n"); -#else storeAppendPrintf(sentry, "ICP Messages handled per comm_select_icp_incoming() call:\n"); -#endif statHistDump(&f->comm_icp_incoming, sentry, statHistIntDumper); -#ifdef HAVE_POLL - storeAppendPrintf(sentry, "DNS Messages handled per comm_poll_dns_incoming() call:\n"); -#else storeAppendPrintf(sentry, "DNS Messages handled per comm_select_dns_incoming() call:\n"); -#endif statHistDump(&f->comm_dns_incoming, sentry, statHistIntDumper); -#ifdef HAVE_POLL - storeAppendPrintf(sentry, "HTTP Messages handled per comm_poll_http_incoming() call:\n"); -#else storeAppendPrintf(sentry, "HTTP Messages handled per comm_select_http_incoming() call:\n"); -#endif statHistDump(&f->comm_http_incoming, sentry, statHistIntDumper); } @@ -1109,3 +735,5 @@ comm_quick_poll_required(void) { MAX_POLL_TIME = 10; } + +#endif /* USE_SELECT */ diff --git a/src/fd.cc b/src/fd.cc index 98e172b621..f1fd80f8f3 100644 --- a/src/fd.cc +++ b/src/fd.cc @@ -1,6 +1,6 @@ /* - * $Id: fd.cc,v 1.43 2001/08/26 22:24:56 hno Exp $ + * $Id: fd.cc,v 1.44 2001/12/24 15:33:43 adrian Exp $ * * DEBUG: section 51 Filedescriptor Functions * AUTHOR: Duane Wessels @@ -84,11 +84,11 @@ fd_close(int fd) assert(F->write_handler == NULL); } debug(51, 3) ("fd_close FD %d %s\n", fd, F->desc); + commSetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0); + commSetSelect(fd, COMM_SELECT_WRITE, NULL, NULL, 0); F->flags.open = 0; fdUpdateBiggest(fd, 0); Number_FD--; - commUpdateReadBits(fd, NULL); - commUpdateWriteBits(fd, NULL); memset(F, '\0', sizeof(fde)); F->timeout = 0; } diff --git a/src/ipc.cc b/src/ipc.cc index b8638d4530..756685260f 100644 --- a/src/ipc.cc +++ b/src/ipc.cc @@ -1,6 +1,6 @@ /* - * $Id: ipc.cc,v 1.26 2001/10/17 20:25:02 hno Exp $ + * $Id: ipc.cc,v 1.27 2001/12/24 15:33:43 adrian Exp $ * * DEBUG: section 54 Interprocess Communication * AUTHOR: Duane Wessels @@ -74,7 +74,7 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name #endif int x; -#if HAVE_POLL && defined(_SQUID_OSF_) +#if USE_POLL && defined(_SQUID_OSF_) assert(type != IPC_FIFO); #endif diff --git a/src/main.cc b/src/main.cc index 09a3615521..777fa43a69 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.345 2001/10/24 06:55:44 hno Exp $ + * $Id: main.cc,v 1.346 2001/12/24 15:33:43 adrian Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -720,11 +720,7 @@ main(int argc, char **argv) eventRun(); if ((loop_delay = eventNextTime()) < 0) loop_delay = 0; -#if HAVE_POLL - switch (comm_poll(loop_delay)) { -#else switch (comm_select(loop_delay)) { -#endif case COMM_OK: errcount = 0; /* reset if successful */ break; diff --git a/src/protos.h b/src/protos.h index 32ca2725cd..79be53a22c 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.420 2001/11/13 21:27:48 hno Exp $ + * $Id: protos.h,v 1.421 2001/12/24 15:33:43 adrian Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -174,19 +174,15 @@ extern int commSetTimeout(int fd, int, PF *, void *); extern void commSetDefer(int fd, DEFER * func, void *); extern int ignoreErrno(int); extern void commCloseAllSockets(void); +extern void checkTimeouts(void); +extern int commDeferRead(int fd); /* * comm_select.c */ extern void comm_select_init(void); -#if HAVE_POLL -extern int comm_poll(int); -#else extern int comm_select(int); -#endif -extern void commUpdateReadBits(int, PF *); -extern void commUpdateWriteBits(int, PF *); extern void comm_quick_poll_required(void); extern void packerToStoreInit(Packer * p, StoreEntry * e); diff --git a/src/stat.cc b/src/stat.cc index 5b20934304..fd135b36bf 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,6 +1,6 @@ /* - * $Id: stat.cc,v 1.351 2001/10/24 08:19:08 hno Exp $ + * $Id: stat.cc,v 1.352 2001/12/24 15:33:44 adrian Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -801,9 +801,10 @@ statAvgDump(StoreEntry * sentry, int minutes, int hours) storeAppendPrintf(sentry, "aborted_requests = %f/sec\n", XAVG(aborted_requests)); -#if HAVE_POLL +#if USE_POLL storeAppendPrintf(sentry, "syscalls.polls = %f/sec\n", XAVG(syscalls.polls)); -#else +#endif +#if USE_SELECT storeAppendPrintf(sentry, "syscalls.selects = %f/sec\n", XAVG(syscalls.selects)); #endif storeAppendPrintf(sentry, "syscalls.disk.opens = %f/sec\n", XAVG(syscalls.disk.opens)); diff --git a/src/unlinkd.cc b/src/unlinkd.cc index 2d71381f18..7d897759ea 100644 --- a/src/unlinkd.cc +++ b/src/unlinkd.cc @@ -1,6 +1,6 @@ /* - * $Id: unlinkd.cc,v 1.44 2001/10/17 20:25:03 hno Exp $ + * $Id: unlinkd.cc,v 1.45 2001/12/24 15:33:44 adrian Exp $ * * DEBUG: section 12 Unlink Daemon * AUTHOR: Duane Wessels @@ -163,7 +163,7 @@ unlinkdInit(void) struct timeval slp; args[0] = "(unlinkd)"; args[1] = NULL; -#if HAVE_POLL && defined(_SQUID_OSF_) +#if USE_POLL && defined(_SQUID_OSF_) /* pipes and poll() don't get along on DUNIX -DW */ x = ipcCreate(IPC_TCP_SOCKET, #else