From f5c55e8e12e99ef03053e202286ad58ffe5fc5d6 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Thu, 15 May 2008 07:30:53 -0600 Subject: [PATCH] Author: Joshua Root Bug 2204: configure fails to detect max open files The behaviour of setrusage has changed in Mac OS X 10.5. --- configure.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure.in b/configure.in index eac737b4aa..0be00547de 100644 --- a/configure.in +++ b/configure.in @@ -2958,7 +2958,12 @@ main() { if (getrlimit(RLIMIT_NOFILE, &rl) < 0) { perror("getrlimit: RLIMIT_NOFILE"); } else { +#if defined(__APPLE__) + /* asking for more than OPEN_MAX fails on Leopard */ + rl.rlim_cur = (OPEN_MAX < rl.rlim_max ? OPEN_MAX : rl.rlim_max); +#else rl.rlim_cur = rl.rlim_max; /* set it to the max */ +#endif if (setrlimit(RLIMIT_NOFILE, &rl) < 0) { perror("setrlimit: RLIMIT_NOFILE"); } -- 2.47.2