3.1.6 system() fails when at the ulimit of open files

View: New views
2 Messages — Rating Filter:   Alert me  

3.1.6 system() fails when at the ulimit of open files

by Chris Pearson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

With an open file limit of 1024:

mkdir z

yes|head -200|gawk '{print "hi" > ("z/"z++)}END{system("echo
hiho;date")}'   # the system() call works
yes|head -2000|gawk '{print "hi" > ("z/"z++)}END{system("echo
hiho;date")}'   # the system() call doesnt work, even though all 2000
files are created.

So, I guess whatever decides to make room to open a new file getting
called for system(), which is inconsistant with how open file juggling
is handled by gawk in other cases, and probably easily fixed.   Or at
the very least should print an error if not.



Re: 3.1.6 system() fails when at the ulimit of open files

by Chris Pearson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This also applies to opening or reopening system()-like targets of |

On Wed, Oct 14, 2009 at 8:45 AM, Chris Pearson <kermit4@...> wrote:

> With an open file limit of 1024:
>
> mkdir z
>
> yes|head -200|gawk '{print "hi" > ("z/"z++)}END{system("echo
> hiho;date")}'   # the system() call works
> yes|head -2000|gawk '{print "hi" > ("z/"z++)}END{system("echo
> hiho;date")}'   # the system() call doesnt work, even though all 2000
> files are created.
>
> So, I guess whatever decides to make room to open a new file getting
> called for system(), which is inconsistant with how open file juggling
> is handled by gawk in other cases, and probably easily fixed.   Or at
> the very least should print an error if not.
>