INF: DLLs Built with C 5.1 LLIBCDLL.LIB Limited to 20 Files

ID Number: Q50335

5.10 6.00 6.00a 6.00ax | 5.10 6.00 6.00a

MS-DOS | OS/2

Summary:

In Microsoft C versions 5.1, 6.0, 6.0a, and 6.0ax, dynamic link

libraries (DLL) built with LLIBCDLL.LIB are limited to having 20 files

open at one time. This limit of 20 files includes the six files

automatically used by OS/2 for stdin, stdout, and stderr (file handles

0, 1, and 2), plus three additional file handles used by the OS/2

subsystem, which leaves 14 files available for the DLL to use. The

file limit applies to low-level files opened with the open() function

and to buffered stream files opened with fopen().

More Information:

Tests have shown that a single-thread DLL can open a 21st file (with

file handle 20) without apparent error, and additional files with

errors, but reading from or writing to these files fails with errors,

and the 21st and additional files have zero length. The perror()

function issues the error message "Too many open files" when

attempting to open files after file handle 20, and perror() issues

"Bad file number" when attempting to write to these files.

The multithread, statically linked library LLIBCMT.LIB, and the

multithread, dynamically linked library CRTLIB.DLL or CEXAMPLE.DLL

both allow a total of 40 file handles or buffered streams. This total

includes the six files used by OS/2, leaving applications or DLLs with

34 files available.

Additional reference words: 5.10 6.00 6.00a 6.00ax