[comp.lang.c] Question on increasing File Handle limit in MSC

ericsa@microsoft.UUCP (Eric SASSAMAN) (05/02/90)

> > higgins@garnet.berkeley.edu writes:
> >
> > QUESTION: What do I need to do to MSC 5.1 in order to increase the
> > number of openned files. Is it somewhere in the startup routine that
> > calls main().
>
> Exactly where it is in the MSC code, I don't know, but many C
> compilers set up a fixed-length array to hold the addresses of the
> FILE structures relating to open files. Typically, it's in the
> libraries somewhere, and there's a definition
>
>     #define MAXFILES 20
>
> or something similar in one of the headers (most likely stdio.h). Call
> Microsoft and ask them. 'Course, they'll probably tell you to go "to
> the place where it's never cold". 8-)

Under OS/2, you can increase the number of available file handles
available to the current process (and any of it's child processes)
with the call DosSetMaxFH, which is documented in the OS/2
Programmer's Reference, Volume 3 (for 1.1) and Volume 4 (for 1.2). The
maximum number of available handles must be between 20 and 255 (the
upper limit increases to 32,768 under OS/2 1.2). By the way, the
FILES= statement in your config.sys is only used by the DOS box. It is
not used by OS/2. Under OS/2, the default maximum file handles is 20.
Also, remember that handles 0, 1, and 2 are already in use by stdin,
stdout, and stderr.

If you are using standard C I/O calls, such as fopen(), then you will
have a compiler imposed limit on the maximum number of file handles
available. Please see the file README.DOC included with either MSC 5.1
or MSC 6.0. README.DOC contains detailed information on how to
increase the maximum number of available file handles. README.DOC is
on the "setup" disk for both versions.

This should take care of your problem of running out of file handles.

And I don't think Microsoft would have said that :-)