From owner-freebsd-hackers Tue Oct 17 02:33:54 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id CAA20639 for hackers-outgoing; Tue, 17 Oct 1995 02:33:54 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id CAA20609 ; Tue, 17 Oct 1995 02:33:31 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id TAA03697; Tue, 17 Oct 1995 19:29:19 +1000 Date: Tue, 17 Oct 1995 19:29:19 +1000 From: Bruce Evans Message-Id: <199510170929.TAA03697@godzilla.zeta.org.au> To: bakul@netcom.com, terry@lambert.org Subject: Re: getdtablesize() broken? Cc: current@freefall.freebsd.org, hackers@freefall.freebsd.org Sender: owner-hackers@FreeBSD.org Precedence: bulk >(BTW, If you don't change the limit, you will discover an off by >one bug: the default limit is 64 but you can only open 63 fds) I get 64. Perhaps you have a shell bug. >So I can do everything with fd > 255 except select(). This >happens because of this line in /sys/kern/sys_generic.c:select() > if (uap->nd > FD_SETSIZE) >It should be replaced with > if (uap->nd > p->fd->fd_nfiles) >It is this hardwired use of FD_SETSIZE *in* the kernel I am >bitching about. This would just give random errors or clobber the kernel stack. The limit is built in to the fd_set type. The FD_SETSIZE check just makes sure that all the bits fit in the kernel fd_set variables. The kernel needs to use dynamically allocated arrays to hold more bits, and different methods to access the bits... Bruce