]> err.no Git - varnish/commitdiff
Use getdtablesize() to size bitmap if we have it.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 29 Jan 2008 08:45:40 +0000 (08:45 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 29 Jan 2008 08:45:40 +0000 (08:45 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2394 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_acceptor_kqueue.c
varnish-cache/configure.ac

index 943ac37fb6dc4506d55f97e0b88c0924a2ddc753..e08be6f3a3e03a7379e55822a986606f6e13cc0c 100644 (file)
@@ -86,8 +86,13 @@ vbit_init(unsigned initial)
 
        vb = calloc(sizeof *vb, 1);
        AN(vb);
-       if (initial == 0)
+       if (initial == 0) {
+#ifdef HAVE_GETDTABLESIZE
+               initial = getdtablesize();
+#else
                initial = VBITMAP_LUMP;
+#endif
+       }
        vbit_expand(vb, initial);
        return (vb);
 }
index dde05bad964e7a87e02296b29aaebcd8d1d832fa..224ce086b78d51f946f03eb0809e85ff2dd31158 100644 (file)
@@ -101,6 +101,7 @@ AC_FUNC_STRERROR_R
 AC_CHECK_FUNCS([socket])
 AC_CHECK_FUNCS([strptime])
 AC_CHECK_FUNCS([fmtcheck])
+AC_CHECK_FUNCS([getdtablesize])
 
 # Don't look for sendfile at all, none of them work
 # anyway. (don't tell when done with passed mem-range)