From owner-freebsd-hackers Fri Dec 13 14:03:53 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id OAA20523 for hackers-outgoing; Fri, 13 Dec 1996 14:03:53 -0800 (PST) Received: from blacklodge.c2.net (root@blacklodge.c2.net [140.174.185.21]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id OAA20495; Fri, 13 Dec 1996 14:03:43 -0800 (PST) Received: (from sameer@localhost) by blacklodge.c2.net (8.7.6/8.7.3) id OAA00366; Fri, 13 Dec 1996 14:05:02 -0800 (PST) From: sameer Message-Id: <199612132205.OAA00366@blacklodge.c2.net> Subject: Re: getdtablesize, OPEN_MAX, and sysctl To: bde@zeta.org.au (Bruce Evans) Date: Fri, 13 Dec 1996 14:05:02 -0800 (PST) Cc: freebsd-hackers@FreeBSD.ORG, freebsd-questions@FreeBSD.ORG, sameer@c2.net In-Reply-To: <199612130854.TAA26648@godzilla.zeta.org.au> from Bruce Evans at "Dec 13, 96 07:54:23 pm" X-Mailer: ELM [version 2.4ME+ PL22 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > So I have a machine (2.1-STABLE) with OPEN_MAX set to 256. > >When I do sysctl -a kern.maxfiles is 2088. Is there a relationship > >between OPEN_MAX and something that shows up in sysctl? > > No. OPEN_MAX is broken and should never be used. It is currently > used in /usr/src only to configure the number of descriptors for the > for the init process. This value is inherited by child processes. By OPEN_MAX I am referring to the options OPEN_MAX=XX in the kernel config file. I thought that OPEN_MAX was the thing to use for setting max # of fds in your kernel. If that isn't it, what should I use? > > On the last two machines, the select runs fine On the first > >two, the select (the result of the getdtablesize() is going to the > >first arg of the select() call) returns EINVAL. > > select() only supports a fixed maximum number of descriptors in > -stable. The default is FD_SETSIZE = 256. 2.2 and -current support > any reasonable number provided the application is compiled with > FD_SETSIZE defined as a larger number. > I'm pretty sure this is the problem. Are you saying that on 2.1-stable you can't do a select on more than 256 fds, and on 2.2 and -current you can do a select on more than 256 fds but you need to make sure you #define FD_SETSIZE first? -- Sameer Parekh Voice: 510-986-8770 President FAX: 510-986-8777 C2Net http://www.c2.net/ sameer@c2.net