Help: open file limit (Sun-4)
Christopher Lyle Johnson
cjohnson at unisoft.UUCP
Sat Feb 11 11:52:31 AEST 1989
In article <4813 at macom1.UUCP> quester at macom1.UUCP (K. N. Quester) writes:
>
>1. How do I increase the per-process open file limit (beyond 30)?
>
Without source? Ask Sun.
>2. What is the meaning of the note in "param.h":
>
> #define NOFILES 30 /* max number of open files per process */
> /* Must be <=31, see pte.h */
>
>Should it have been obvious when I looked at pte.h (it wasn't, to me)?
>--
> - Quester (UUCP: grebyn!macom1!quester)
The comment "see pte.h" is an artifact of the 4.2BSD VAX implementation.
The VAX mmu code uses the page table entry to store the block offset of
the backing file (text segment) or swap space (data/stack) for pages
that were paged out. The pte is marked invalid so the extra bits are
available in these cases.
The vax/pte.h fpte structure is used in this case, and it has a 5 bit
field called 'pg_fileno'. This field is intended to represent the file
descriptor to load the page from for areas that the process has mmap'ed.
With 5 bits, numbers between 0 and 31 are legal, but if the pg_fileno
field is 0 the page fault was in the text region. Thus the maximum
number of files mmap'able is 31, and that was the limit on NOFILE.
Of course, the mmap system call was fiction so the comment is slightly
misleading. In 4.3 the comment was removed, the fpte structure was
changed, NOFILE was bumped up to 64, and mmap was ignored.
Have fun,
cj*
More information about the Comp.unix.wizards
mailing list