From owner-freebsd-hackers Wed Nov 11 00:25:58 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA20087 for freebsd-hackers-outgoing; Wed, 11 Nov 1998 00:25:58 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp04.primenet.com (smtp04.primenet.com [206.165.6.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA20074 for ; Wed, 11 Nov 1998 00:25:54 -0800 (PST) (envelope-from tlambert@usr02.primenet.com) Received: (from daemon@localhost) by smtp04.primenet.com (8.8.8/8.8.8) id BAA13324; Wed, 11 Nov 1998 01:25:37 -0700 (MST) Received: from usr02.primenet.com(206.165.6.202) via SMTP by smtp04.primenet.com, id smtpd013316; Wed Nov 11 01:25:37 1998 Received: (from tlambert@localhost) by usr02.primenet.com (8.8.5/8.8.5) id BAA06296; Wed, 11 Nov 1998 01:25:31 -0700 (MST) From: Terry Lambert Message-Id: <199811110825.BAA06296@usr02.primenet.com> Subject: Re: Supporting more than FD_SETSIZE fd's To: nate@mt.sri.com (Nate Williams) Date: Wed, 11 Nov 1998 08:25:31 +0000 (GMT) Cc: hackers@FreeBSD.ORG In-Reply-To: <199811091734.KAA04752@mt.sri.com> from "Nate Williams" at Nov 9, 98 10:34:00 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > I looked through the handbook and the FAQ and didn't find anything, so > hopefully someone can help me out. > > I need to support more than the default 255 FD's in an application (the > JDK for what it's worth). To be portable, the code uses fd_set as > defined in . Unfortunately, unless I redefine FD_SETSIZE > in every file that uses it, I still have a hard-limit on the number of > FD's the application can use. > > Is there any 'portable' way of getting around this? Redefine FD_SETSIZE. If you don't wwant to do it in every file that uses it, then either do it in the header file itself, or add -DFD_SETSIZE=1024 to CFLAGS. > I'd really like to > have it use whichever open FD that the limit allows, but I know now way > of having this happen? I can't really parse this. The "the limit allows" value is based on how many contiguous bits there are in an fd_set, which is based on the value of FD_SETSIZE at the time the fd_set is declared. Basically, the first argument is how many bits into the fd_set that select is supposed to index looking for FD_ISSET bits to select fd's to select on... Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message