🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #2708

DOS or Turbo bug: you be the judge...

#2708
From: David Wood
Date: Thu, 18 Oct 1990 18:34
45 lines
2368 bytes
PLEEEEEEEEASE HELP!!!!!!

I have a problem that does not seem to be documented in any of my
stacks of DOS and Turbo-C manuals.  I am attempting to use DOS
function 67h to increase available file handles.  I need to insert
this capability into a rather large program (~250K executable), so I
tried it out first in a small test program.

Here's the problem: if I compile the test program using the SMALL
memory model (or medium), everything works fine.  However, if I
compile it using the LARGE model, it doesn't work: it allows me to
open any number of files using open(), but as soon as I try to open
one with fopen(), DOS allocates all available memory and the open
fails.  After some trial-and-error, I found that this problem only
manifests itself if I request DOS to permit 49 or more file handles.
If I request 48 or less, everything works as expected.  I've tried to
vary the FILES= value, but with no effect.

I have implemented the DOS interrupt call both via calls to intdos()
as well as via inline assembly code; the thing malfunctions either
way.

Does anyone out there know if this is a DOS bug, a Turbo C (actually
Turbo C++) bug, or am I just doing something wrong?  

Another note: if I run the PD program FILES33 (a TSR to increase file
handles limit), before running my test program, everything works fine.
However, neither FILES33 nor my test program work properly
independently.  Unfortunately, I need to have a single executable, so
this solution is not adequate.

SPECS: I'm running on an 8M 386 with DOS 4.0 and Turbo C++.  I need to
be able to open up to about 150 files using open() and about 10 using
fopen().

Thanks to anyone who can help.  E-mail is preferred; if I get a
solution e-mailed to me, I'll post the solution after testing it out.

--Dave Wood
-- 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Technical Details
Message-ID: <9111@fy.sei.cmu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!wuarchive!julius.cs.uiuc.edu!psuvax1!rutgers!rochester!pt.cs.cmu.edu!sei!dpw

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!wuarchive!julius.cs.uiuc.edu!psuvax1!rutgers!rochester!pt.cs.cmu.edu!sei!dpw
From: dpw@sei.cmu.edu (David Wood)
Newsgroups: comp.os.msdos.programmer
Subject: DOS or Turbo bug: you be the judge...
Message-ID: <9111@fy.sei.cmu.edu>
Date: 18 Oct 90 18:34:33 GMT
Organization: Carnegie-Mellon University (Software Engineering Institute), Pgh, PA
Lines: 45