]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
change check for extended mallinfo structure
authorwessels <>
Tue, 16 Apr 1996 00:00:24 +0000 (00:00 +0000)
committerwessels <>
Tue, 16 Apr 1996 00:00:24 +0000 (00:00 +0000)
configure
configure.in
include/autoconf.h.in
src/stat.cc
src/tools.cc

index cd43940bb17dee373ab928a7d352b2a98998dcb3..fe9b9ac4f195807c8a1e69238a86c369a425b485 100755 (executable)
--- 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 <<EOF
-#line 1258 "configure"
-#include "confdefs.h"
-#include <time.h>
-#include <sys/time.h>
-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
-#line 1310 "configure"
+#line 1284 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
@@ -1335,15 +1309,54 @@ fi
 done
 
 
+echo $ac_n "checking for tm->tm_gmtoff""... $ac_c" 1>&6
 cat > conftest.$ac_ext <<EOF
-#line 1340 "configure"
+#line 1315 "configure"
 #include "confdefs.h"
+#include <time.h>
+#include <sys/time.h>
+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 <<EOF
+#line 1341 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
 #include <malloc.h>
+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 <<EOF
-#line 1360 "configure"
+#line 1373 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 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 <<EOF
-#line 1394 "configure"
+#line 1407 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 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 <<EOF
-#line 1428 "configure"
+#line 1441 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 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 <<EOF
-#line 1460 "configure"
+#line 1473 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -1515,7 +1528,7 @@ if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1519 "configure"
+#line 1532 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -1544,7 +1557,7 @@ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1548 "configure"
+#line 1561 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1598,7 +1611,7 @@ else
   ac_cv_c_stack_direction=0
 else
 cat > conftest.$ac_ext <<EOF
-#line 1602 "configure"
+#line 1615 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -1643,7 +1656,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1647 "configure"
+#line 1660 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1683,7 +1696,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmalloc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1687 "configure"
+#line 1700 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1717,7 +1730,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1721 "configure"
+#line 1734 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1757,7 +1770,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1761 "configure"
+#line 1774 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1797,7 +1810,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbsd  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1801 "configure"
+#line 1814 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1838,7 +1851,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l44bsd  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1842 "configure"
+#line 1855 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1872,7 +1885,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1876 "configure"
+#line 1889 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1907,7 +1920,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1911 "configure"
+#line 1924 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1969,7 +1982,7 @@ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1973 "configure"
+#line 1986 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
index e0f4a5c48dbe6f9df350c3ac269a5aad5a0560f9..4a621949af9951df5b2a38093a5fa880d7c30b59 100644 (file)
@@ -3,13 +3,13 @@ dnl  Configuration input file for Squid
 dnl
 dnl  Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.7)
 dnl
-dnl  $Id: configure.in,v 1.15 1996/04/15 03:50:47 wessels Exp $
+dnl  $Id: configure.in,v 1.16 1996/04/15 18:00:24 wessels Exp $
 dnl
 dnl
 dnl
 AC_INIT(src/main.c)
 AC_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.15 $)dnl
+AC_REVISION($Revision: 1.16 $)dnl
 AC_PREFIX_DEFAULT(/usr/local/squid)
 AC_CONFIG_AUX_DIR(aux)
 
@@ -96,15 +96,6 @@ dnl Check for headers
 AC_HEADER_DIRENT
 AC_HEADER_STDC
 
-AC_MSG_CHECKING(for tm->tm_gmtoff)
-AC_TRY_COMPILE([#include <time.h>
-#include <sys/time.h>],
-[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 <time.h>
+#include <sys/time.h>],
+[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 <sys/types.h>
+#include <malloc.h>],
+[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)
index ac614c2621d1c02088104597107e750e535f1994..4fc28f502409562e1035d22f02ef49f499845218 100644 (file)
@@ -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
 
index 5817479ad3b460b1289892875589ebdd60427803..0ef8eebd09d4b601983d568ec1ba39ad11192de0 100644 (file)
@@ -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 */
 
index 07c5830f6340e057efe222155d83f0e640d4fea1..ee689c91c2e8ce0953c88a73e4c70455d05b2db1 100644 (file)
@@ -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? */
 }