From owner-freebsd-hackers Mon Nov 9 10:26:40 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA03578 for freebsd-hackers-outgoing; Mon, 9 Nov 1998 10:26:40 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from ns.mt.sri.com (sri-gw.MT.net [206.127.105.141]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA03564 for ; Mon, 9 Nov 1998 10:26:36 -0800 (PST) (envelope-from nate@mt.sri.com) Received: from mt.sri.com (rocky.mt.sri.com [206.127.76.100]) by ns.mt.sri.com (8.8.8/8.8.8) with SMTP id LAA06476; Mon, 9 Nov 1998 11:26:21 -0700 (MST) (envelope-from nate@rocky.mt.sri.com) Received: by mt.sri.com (SMI-8.6/SMI-SVR4) id LAA05253; Mon, 9 Nov 1998 11:26:16 -0700 Date: Mon, 9 Nov 1998 11:26:16 -0700 Message-Id: <199811091826.LAA05253@mt.sri.com> From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Marc Slemko Cc: Nate Williams , hackers@FreeBSD.ORG Subject: Re: Supporting more than FD_SETSIZE fd's In-Reply-To: References: <199811091734.KAA04752@mt.sri.com> X-Mailer: VM 6.34 under 19.16 "Lille" XEmacs Lucid Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > I need to support more than the default 255 FD's in an application (the > > JDK for what it's worth). ... > > I looked through the code in Apache, and I don't see how it does this, > > since I never saw any re-definition of FD_SETSIZE, or use of anything > > other than fd_setsize. (Although, I did see mention of FD_SETSIZE quite > > a bit in the comments.) > > Apache doesn't use select() on high numbered descriptors so it doesn't > matter. How does it determine if there is data on those FD's w/out select? I would think that if you have more than 255 active FD's (pretty common) then you'd have a problem. > FD_SETSIZE doesn't limit the number of descriptors, it just limits the > highest descriptor you can pass to select(). Right, hence my question on how other applications deal with the problem, since select doesn't have inherent limitation. > There are various possible workarounds: > > - use poll(). Only on 3.0 unfortunately. > > - on 3.0, FD_SETSIZE defaults to 1024. I'm on 2.2.* > - redefine FD_SETSIZE before including sys/types.h. This may seem to be a > pain, but in most large projects you should have some common header files > you can use for that anyway. This doesn't fix any libraries that you use > though, which may use select() internally with a small FD_SETSIZE. No external libraries are used except for Motif. I'm not sure if it uses Select, but I doubt it. In any case, I'm still defaulting to a larger limit, which is still not a great solution. > Note that Solaris 2.6 is limited to a FD_SETSIZE of 256 (which can't be > changed), so they must have some way around that. Is likely using poll() > though. Solaris/Linux both use poll, which again doesn't exist on 2.2. Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message