Subject: kern/29136: Added description for MAXFILES to options.4
To: None <,,>
From: None <>
List: netbsd-bugs
Date: 01/27/2005 16:00:01
>Number:         29136
>Category:       kern
>Synopsis:       Added  description for MAXFILES to options.4
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 27 16:00:00 +0000 2005
>Originator:     Gene ENonymous
>Release:        i386 1.6.2(Stable)
NetBSD lickety 1.6.2_STABLE NetBSD 1.6.2_STABLE (MYSMALL) #4: Tue Jan 25 18:26:40 EST 2005     root@lickety:/home/src/sys/arch/i386/compile/MYSMALL i386

I was having a problem with insufficient max_file_descriptors
available for a package. I could not find any help in the options(4)
kernel config options.

After digging around on the mailing lists for a couple of hours,
I found the solution on this thread:

In the last paragraph, the referenced message (by Greg A. Woods)
suggests that this option (among others) should really be
referenced in options(4). I have taken the liberty of
hacking the options.4 source to read as follows:

     options NOFILE=integer
     Sets the soft RLIMIT_NOFILE resource limit, which specifies the maximum
     number of open file descriptors for each process; this value is inherited
     by its child processes.  It defaults to OPEN_MAX, which is currently de-
     fined to be 64. See also "options MAXFILES=integer" if the hard limit
     needs to be increased.

     options MAXFILES=integer
     Overrides the preprocessor logic in param.c which sets the system-wide
     hard limit on open file table entries per the following algorithm:

           #ifndef MAXFILES
           #define MAXFILES        (3 * (NPROC + MAXUSERS) + 80)

I received a suggestion from the tech-kern mailing list to submit my change per the pr process. This is a documentation issue that probably applies to all past and present versions of NetBSD.
I have put the modified source on: