TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Paul Edwards
from: Mike Bilow
date: 1995-11-13 16:21:52
subject: watcom and warp

Paul Edwards wrote in a message to All:

 PE> I used to be able to open 92 files under OS/2 2.1 with the
 PE> below program, but under OS/2 3.0 I can only get 13.  Has
 PE> something changed with regards to file handles?  The
 PE> executable is unchanged, and compiled with Watcom.

This is a Watcom-specific issue.  See the section of the Programmer's Guide
"Commonly Asked Questions and Answers: How more than 20 files at a
time can be opened."  You need to use the operating system-independent
_grow_handles() function to notify the run-time library to allocate more
static FILE objects for fopen() to return.  The Watcom _grow_handles()
function also performs the necessary notifications to the operating system
where this is supported, as in OS/2 with the DosSetMaxFH() API call.

I don't know why this would vary when running the same executable on
different versions of OS/2, however.  This might be an interaction with the
MMOS2 code that reportedly increased the default number of file handles
improperly.
 
-- Mike


--- 
* Origin: N1BEE BBS +1 401 944 8498 V.34/V.FC/V.32bis/HST16.8 (1:323/107)
SEEN-BY: 270/101 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 517 628 713/888 800/1 7877/2809
@PATH: 323/107 150 3615/50 396/1 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.