Date: Wed, 19 Jun 1996 14:04:20 GMT From: James Raynard <fqueries@jraynard.demon.co.uk> To: af@biomath.jussieu.fr Cc: freebsd-questions@freebsd.org Subject: Re: Max first parameter of a Select call? Message-ID: <199606191404.OAA20852@jraynard.demon.co.uk> In-Reply-To: <199606190804.AA28032@iaka.biomath.jussieu.fr> (message from Alain FAUCONNET on Wed, 19 Jun 1996 09:04:52 %2B0100 (GMT%2B0100))
next in thread | previous in thread | raw e-mail | index | archive | help
> > How do you get the 'select' call in FreeBSD to be happy with something > > greater than 256 as a first parameter? > > Anything above this seems to give a "Select error 22 - invalid argument" > > > > Not a reply, just a followup: this "feature" seems to have a lot of > interesting side effects on my machine (2.1-STABLE pre-earthquake). > When I set user resources limits to hard limits ("unlimit" C-shell > command) and the max file descriptors goes >> 256, sudo no longer > works ("Password:" prompt exits immediately), fvwm sets system load at > 1.0 permanently. I have ktraced fvwm and actually saw that select > returning an error. Everything goes back to normal when I set max fd > <= 256. Hmm. As I understand the select() man page, a user program can increase FD_SETSIZE above the value specified in <sys/types.h>, which just happens to be 256, but not above the value compiled into the kernel. However, <sys/types.h> is a copy of the types.h used in compiling the kernel, which is where the kernel picks up its value of FD_SETSIZE from. So a user program can never safely use FD_SETSIZE > 256 without a kernel re-compile first! Perhaps we need a FD_SETSIZE option in the kernel config file? (I have a vague memory of seeing one once, but there's no record of it in my CVS tree). -- James Raynard, Edinburgh, Scotland james@jraynard.demon.co.uk
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606191404.OAA20852>