3 # Open in their package.
9 # But only this sub name is visible to them.
16 if (!$isopen{$file}) {
17 if (++$numopen > $maxopen) {
18 sub byseq {$isopen{$a} != $isopen{$b};}
19 local(@lru) = sort byseq keys(%isopen);
20 splice(@lru, $maxopen / 3);
22 for (@lru) { close $_; delete $isopen{$_}; }
24 &open($file, ($saw{$file}++ ? '>>' : '>') . $file)
25 || die "Can't create $file: $!\n";
27 $isopen{$file} = ++$seq;
35 if (open(PARAM,'/usr/include/sys/param.h')) {
38 $maxopen = $1 - 4 if /^#define NOFILE\s+(\d+)/;
42 $maxopen = 16 unless $maxopen;