KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q42929: Limit of 40 Files with LLIBCMT.LIB and LLIBCDLL.LIB

Article: Q42929
Product(s): See article
Version(s): 5.10
Operating System(s): OS/2
Keyword(s): ENDUSER | | mspl13_c
Last Modified: 25-JUL-1990

Start-up source code is provided for the real- and protected-mode
standard C run-time libraries. This code can be modified to allow more
file handles and stream pointers to be opened by a process.

This start-up code is not designed for LLIBCMT.LIB or CRTLIB.DLL.
These are the protected-mode libraries for multithreaded applications
and DLLs. The file and stream limits on both of these libraries are
hard coded at 40.

Handles 0, 1, and 2 are opened by C for stdin, stdout, and stderr,
while handles 3, 7, and 8 are opened by different OS/2 subsystems.
With these file handles taken, 34 files can be opened at once.

Note: This restrictin has been removed from the C 6.0 version of these
libraries. In fact, even with C 5.10, the open file count could be
bumped up using DosSetMaxFH().  The problem was with the streams. In C
6.0, the readme.doc file details how to increase the file stream count
also.

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.