Open File Problems - WIERD!!!
Mon May 31 21:10:00 GMT 1999
Ian Collins <firstname.lastname@example.org> writes:
> Can someone please help me with this. I have reproduced the problem on three
> seperate gnu-win32 installs.
> All three gnu-win32 installs are running on B20.1 using gcc version
> egcs-2.91.57 19980901 (egcs-1.1 release).
> The problem manifests itself after a program has opened it's 30th file. I
> see shell errors appearing ("Pipe call failed"), and even i/o corruptions
> after the 30th file is opened.
> Why should 30 be the magic number? It does not correlate with limits.h
> (which implies 16 is the max for fopen - surely not!!!). (Incidentally, On
> my HPUX machine and SCO, these limits appear to be 60, on Linux this is 256
> and AIX is 2000)
> Note also that I don't get an error from fopen, and also that the when the
> error manifests itself, it is actually in a child process - NOT in the
> process that has all the files open!
> Try this simple program that demonstrates the problem. This program (which
> is functionally useless but demonstrates the point), loops from 0 to 31
> opening a file, file0, file1, ... file31 using fopen. (Not forgetting that
> stdin, stdout and stderr are already open).
> After opening the file, it calls a child process which just uses a pipe
> (ls|cat > /dev/null).
Thanks for the concise to-the-point test case! fwiw, it behaves as
expected with the development snapshots (I'm using 1999-04-27), so
it may just be fixed in the next release.
Want to unsubscribe from this list?
Send a message to email@example.com
More information about the Cygwin