Date: Fri, 13 Dec 1996 14:05:02 -0800 (PST) From: sameer <sameer@c2.net> To: bde@zeta.org.au (Bruce Evans) Cc: freebsd-hackers@FreeBSD.ORG, freebsd-questions@FreeBSD.ORG, sameer@c2.net Subject: Re: getdtablesize, OPEN_MAX, and sysctl Message-ID: <199612132205.OAA00366@blacklodge.c2.net> In-Reply-To: <199612130854.TAA26648@godzilla.zeta.org.au> from Bruce Evans at "Dec 13, 96 07:54:23 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
> > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199612132205.OAA00366>