From 2dc27365ce94c1bd1f9b655d2d1cae1ba6a17a7e Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 29 Jan 2008 08:45:40 +0000 Subject: [PATCH] Use getdtablesize() to size bitmap if we have it. 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 | 7 ++++++- varnish-cache/configure.ac | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c b/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c index 943ac37f..e08be6f3 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c +++ b/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c @@ -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); } diff --git a/varnish-cache/configure.ac b/varnish-cache/configure.ac index dde05bad..224ce086 100644 --- a/varnish-cache/configure.ac +++ b/varnish-cache/configure.ac @@ -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) -- 2.39.5