cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Patch: partial fix for bug #948950

From: David Phillips <electrum_at_gmail.com>
Date: Thu, 18 Nov 2004 15:15:23 -0600

On Thu, 18 Nov 2004 20:33:37 +0100 (CET), Daniel Stenberg
<daniel-curl_at_haxx.se> wrote:
> I guess the test case code must figure this out somehow and act accordingly.

You can use getrlimit(2) and setrlimit(2). They are in POSIX, but it
will likely be necessary to add a check to configure for them. I
suppose that the best thing to do is not open any extra file
descriptors if FD_SETSIZE exceeds getrlimit(RLIMIT_NOFILE)->rlim_max
(in which case it would act like test 500). Also, it might be a
little cleaner to use dup(2) instead of opening /dev/null a number of
times.

-- 
David Phillips <david_at_acz.org>
http://david.acz.org/
Received on 2004-11-18