From: wessels <> Date: Tue, 16 Apr 1996 00:00:24 +0000 (+0000) Subject: change check for extended mallinfo structure X-Git-Tag: SQUID_3_0_PRE1~6175 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=46c883edad298267ac68833a54ee3a91f77b9d00;p=thirdparty%2Fsquid.git change check for extended mallinfo structure --- diff --git a/configure b/configure index cd43940bb1..fe9b9ac4f1 100755 --- a/configure +++ b/configure @@ -517,7 +517,7 @@ fi -# From configure.in Revision: 1.14 +# From configure.in Revision: 1.15 ac_aux_dir= for ac_dir in aux $srcdir/aux; do if test -f $ac_dir/install-sh; then @@ -1252,32 +1252,6 @@ EOF fi -echo $ac_n "checking for tm->tm_gmtoff""... $ac_c" 1>&6 -cat > conftest.$ac_ext < -#include -int main() { return 0; } -int t() { -struct tm foo; -foo.tm_gmtoff = 0; -; return 0; } -EOF -if eval $ac_compile; then - rm -rf conftest* - cat >> confdefs.h <<\EOF -#define HAVE_TM_GMTOFF 1 -EOF - -echo "$ac_t""yes" 1>&6 -else - rm -rf conftest* - echo "$ac_t""no" 1>&6 -fi -rm -f conftest* - - for ac_hdr in \ alloca.h \ @@ -1306,7 +1280,7 @@ 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 @@ -1335,15 +1309,54 @@ fi done +echo $ac_n "checking for tm->tm_gmtoff""... $ac_c" 1>&6 cat > conftest.$ac_ext < +#include +int main() { return 0; } +int t() { +struct tm foo; +foo.tm_gmtoff = 0; +; return 0; } +EOF +if eval $ac_compile; then + rm -rf conftest* + cat >> confdefs.h <<\EOF +#define HAVE_TM_GMTOFF 1 +EOF + +echo "$ac_t""yes" 1>&6 +else + rm -rf conftest* + echo "$ac_t""no" 1>&6 +fi +rm -f conftest* + + +echo $ac_n "checking for extended mallinfo""... $ac_c" 1>&6 +cat > conftest.$ac_ext < #include +int main() { return 0; } +int t() { +struct mallinfo foo; +foo.mxfast = 0; +; return 0; } EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "mxfast" >/dev/null 2>&1; then +if eval $ac_compile; then rm -rf conftest* - XTRA_CFLAGS="$XTRA_CFLAGS -DLNG_MALLINFO" + cat >> confdefs.h <<\EOF +#define HAVE_EXT_MALLINFO 1 +EOF + +echo "$ac_t""yes" 1>&6 +else + rm -rf conftest* + echo "$ac_t""no" 1>&6 fi rm -f conftest* @@ -1356,7 +1369,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1390,7 +1403,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1424,7 +1437,7 @@ 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() { return 0; } @@ -1456,7 +1469,7 @@ if eval "test \"`echo '$''{'ac_cv_func_alloca'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&6 else cat > conftest.$ac_ext <tm_gmtoff) -AC_TRY_COMPILE([#include -#include ], -[struct tm foo; -foo.tm_gmtoff = 0;], -[AC_DEFINE(HAVE_TM_GMTOFF) -AC_MSG_RESULT(yes)], -AC_MSG_RESULT(no)) - AC_CHECK_HEADERS( \ alloca.h \ @@ -127,7 +118,23 @@ AC_CHECK_HEADERS( \ syslog.h \ ) -AC_EGREP_HEADER(mxfast, malloc.h, [XTRA_CFLAGS="$XTRA_CFLAGS -DLNG_MALLINFO"]) +AC_MSG_CHECKING(for tm->tm_gmtoff) +AC_TRY_COMPILE([#include +#include ], +[struct tm foo; +foo.tm_gmtoff = 0;], +[AC_DEFINE(HAVE_TM_GMTOFF) +AC_MSG_RESULT(yes)], +AC_MSG_RESULT(no)) + +AC_MSG_CHECKING(for extended mallinfo) +AC_TRY_COMPILE([#include +#include ], +[struct mallinfo foo; +foo.mxfast = 0;], +[AC_DEFINE(HAVE_EXT_MALLINFO) +AC_MSG_RESULT(yes)], +AC_MSG_RESULT(no)) dnl Check for typedefs AC_CHECK_SIZEOF(int) diff --git a/include/autoconf.h.in b/include/autoconf.h.in index ac614c2621..4fc28f5024 100644 --- a/include/autoconf.h.in +++ b/include/autoconf.h.in @@ -28,6 +28,9 @@ /* Define struct tm has tm_gmtoff member */ #undef HAVE_TM_GMTOFF +/* Define struct mallinfo has mxfast member */ +#undef HAVE_EXT_MALLINFO + /* The number of bytes in a int. */ #undef SIZEOF_INT diff --git a/src/stat.cc b/src/stat.cc index 5817479ad3..0ef8eebd09 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,4 +1,4 @@ -/* $Id: stat.cc,v 1.23 1996/04/14 03:05:50 wessels Exp $ */ +/* $Id: stat.cc,v 1.24 1996/04/15 18:00:28 wessels Exp $ */ /* * DEBUG: Section 18 stat @@ -506,7 +506,7 @@ void info_get(obj, sentry) sprintf(line, "{\tcost of enabling keep option:\t%d}\n", mp.keepcost); storeAppend(sentry, line, strlen(line)); } -#if LNG_MALLINFO +#if HAVE_EXT_MALLINFO sprintf(line, "{\tmax size of small blocks:\t%d}\n", mp.mxfast); storeAppend(sentry, line, strlen(line)); sprintf(line, "{\tnumber of small blocks in a holding block:\t%d}\n", @@ -523,7 +523,7 @@ void info_get(obj, sentry) mp.treeoverhead); storeAppend(sentry, line, strlen(line)); -#endif /* LNG_MALLINFO */ +#endif /* HAVE_EXT_MALLINFO */ #endif /* HAVE_MALLINFO */ diff --git a/src/tools.cc b/src/tools.cc index 07c5830f63..ee689c91c2 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1,5 +1,5 @@ -/* $Id: tools.cc,v 1.30 1996/04/11 23:52:01 wessels Exp $ */ +/* $Id: tools.cc,v 1.31 1996/04/15 18:00:27 wessels Exp $ */ /* * DEBUG: Section 21 tools @@ -80,7 +80,7 @@ static void dumpMallocStats(f) fprintf(f, " space in ordinary blocks in use %d\n", mp.uordblks); fprintf(f, " space in free ordinary blocks %d\n", mp.fordblks); fprintf(f, " cost of enabling keep option %d\n", mp.keepcost); -#if LNG_MALLINFO +#if HAVE_EXT_MALLINFO fprintf(f, " max size of small blocks %d\n", mp.mxfast); fprintf(f, " number of small blocks in a holding block %d\n", mp.nlblks); @@ -91,7 +91,7 @@ static void dumpMallocStats(f) mp.allocated); fprintf(f, " bytes used in maintaining the free tree %d\n", mp.treeoverhead); -#endif /* LNG_MALLINFO */ +#endif /* HAVE_EXT_MALLINFO */ #if PRINT_MMAP mallocmap(); @@ -165,9 +165,16 @@ void normal_shutdown() void shut_down(sig) int sig; { + int i; + FD_ENTRY *f; debug(21, 1, "Preparing for shutdown...\n"); serverConnectionsClose(); ipcacheShutdownServers(); + for(i=fdstat_biggest_fd(); i >= 0; i--) { + f = &fd_table[i]; + if (f->read_handler || f->write_handler || f->except_handler) + comm_set_fd_lifetime(i, 30); + } shutdown_pending = 1; /* reinstall signal handler? */ }