From volf@oasis.IAEhv.nl  Sat Oct 14 13:27:33 1995
Received: from iaehv.IAEhv.nl (root@iaehv.IAEhv.nl [192.87.208.2])
          by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id NAA16876
          for <freebsd-gnats-submit@freebsd.org>; Sat, 14 Oct 1995 13:27:31 -0700
Received: from oasis.IAEhv.nl by iaehv.IAEhv.nl (8.6.12/1.63)
    id VAA16046; Sat, 14 Oct 1995 21:27:26 +0100
Received: by oasis (8.6.12/1.63)
    id VAA01503; Sat, 14 Oct 1995 21:26:16 +0100
Message-Id: <199510142026.VAA01503@oasis>
Date: Sat, 14 Oct 1995 21:26:16 +0100
From: volf@oasis.IAEhv.nl (Frank Volf)
Reply-To: volf@oasis.IAEhv.nl
To: FreeBSD-gnats-submit@freebsd.org
Subject: MAX_OPEN and FD_SETSIZE
X-Send-Pr-Version: 3.2

>Number:         781
>Category:       kern
>Synopsis:       OPEN_MAX in kernel config and FD_SETSIZE in /usr/include/sys/types.h mismatch
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bde
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 14 13:30:01 PDT 1995
>Closed-Date:    Tue Feb 11 16:58:44 PST 1997
>Last-Modified:  Tue Feb 11 17:10:57 PST 1997
>Originator:     Frank Volf
>Release:        FreeBSD 2.0-BUILT-19950603 i386
>Organization:
 ----------------------------------------------------------------------------
       Frank Volf - Internet Access Eindhoven - Digitale Stad Eindhoven 
 ----------------------------------------------------------------------------
  ||  volf@oasis.IAEhv.nl - use for personal mail                         ||
  ||  volf@IAEhv.nl - use for Internet Access Eindhoven related mail      ||
  ||  volf@dse.dse.nl - use for Digital City of Eindhoven related mail    ||
 ----------------------------------------------------------------------------
    IAE Public Access Unix System - Dial +31.40.2439436 and login as new.  
 ----------------------------------------------------------------------------
>Environment:

	FreeBSD 2.0.5 from CD, nothing fancy in the kernel config

>Description:

	The OPEN_MAX define in the kernel configuration can be used to have
	a large number of open file descriptors (e.g. 512),

	getdtablesize returns the value set by OPEN_MAX (this is ok),

	FD_SETSIZE in /usr/include/sys/types.h is defined as 256.
	sys_generic.c (containing the code for select()) is compiled with 
	this FD_SETSIZE set to 256.
	
	The select() fails at runtime if it is called with a nfds > FD_SETSIZE,
	because it is compiled with the FD_SETSIZE value, and does not 
	know about OPEN_MAX > 256

>How-To-Repeat:

	See above.

>Fix:
	
	Preferable automatic generation of the 	types.h file from kernel 
	configuration by /usr/sbin/config.


Please, let me know the status of this bug report (maybe I did something
wrong).

Frank

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->bde 
Responsible-Changed-By: scrappy 
Responsible-Changed-When: Sun May 26 23:41:17 PDT 1996 
Responsible-Changed-Why:  
potentially the wrong person to change to 
State-Changed-From-To: open->closed 
State-Changed-By: jmg 
State-Changed-When: Tue Feb 11 16:58:44 PST 1997 
State-Changed-Why:  
this has been fixed in rev1.19 of sys/kern/sys_generic.c 
now there isn't a limit on fd's to pass to select... 
>Unformatted:
