Subject: bin/37205: nawk: a number of open files is limited to very small constant FNAME_MAX (20)
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <cheusov@tut.by>
List: netbsd-bugs
Date: 10/25/2007 09:35:00
>Number:         37205
>Category:       bin
>Synopsis:       nawk: a number of open files is limited to very small constant FNAME_MAX (20)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 25 09:35:00 +0000 2007
>Originator:     Aleksey Cheusov
>Release:        Linux
>Organization:
home
>Environment:
Linux chel 2.6.18-5-vserver-686 #1 SMP Thu Aug 30 04:29:47 UTC 2007 i686 GNU/Linux

>Description:
NetBSD's awk limits a number of open files to very small constant FNAME_MAX (about 20). Even if awk is used for parsing log files only,
FOPEN_MAX is too small constant for today's needs and today's hardware.

>How-To-Repeat:
awk 'BEGIN {for (i=1; i <= 2000; ++i){print urrra > ("/tmp/file_" i)}}'

>Fix:
See wip/netbsd-awk/patches/patch-ac
There AWK_FOPEN_MAX define is introduced that defaults to FOPEN_MAX
but can easily be changed to any larger constant by changing CFLAGS.