🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to increase max. open file limit per process? Help

#363
From: Alberto Poblacion
Date: Mon, 10 Aug 1992 11:55
45 lines
1924 bytes
In article <1992Aug4.191805.25912@tamsun.tamu.edu> tpradeep@cs.tamu.edu (Pradeep K Tapadiya) writes:
>
>Howdy netters,
>
>Ths MSDOS Encyclopedia (Microsoft Press) says that the maximum
>no. of files that can be opened per process is 20.  Can someone
>please tell me if there is a way to increase this limit.

      There is a table in the Program Segment Prefix that contains space
for 20 open files. The address of the table is at offset 34H in the PSP.
Offset 32H contains the number of entries available in the table.
You can modify this entries in the PSP, and you will be able to open more
files, as long as the FILES statement in your CONFIG.SYS allows it.

/*----- Cut here -----*/
#define MAXTABLAFI 41  /* Maximo de ficheros que intentamos tomar */

#if MSDOS && TURBOC
static void init_morefiles(void)
{
#if MAXTABLAFI>20
int i;
int numtabla,numtablaorig;
unsigned char far *ptabla;
unsigned char far * far *pptabla;
static unsigned char tabla[MAXTABLAFI];

numtablaorig=*(int far *)MK_FP(_psp,0x32);
pptabla=MK_FP(_psp,0x34);
ptabla=*pptabla;
if (numtablaorig>MAXTABLAFI) return;

numtabla = *(int far *)MK_FP(_psp,0x32) = MAXTABLAFI;
for (i=0; i<numtablaorig; i++) tabla[i]=ptabla[i];
for (i=numtablaorig;i<numtabla;i++) tabla[i]=0xff;

*pptabla = (unsigned char far *)tabla;
#endif
}
#endif
/*----- Cut here -----*/

-- 
Alberto Poblacion
E-mail: alberto@proa.es / apb@met.foro.es
Technical Details
Message-ID: <1350@proa.es>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!goya!foro!proa!alberto
References: <1992Aug4.191805.25912@tamsun.tamu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!goya!foro!proa!alberto
From: alberto@proa.es (Alberto Poblacion)
Newsgroups: comp.os.msdos.programmer
Subject: Re: How to increase max. open file limit per process? Help
Summary: Modify table in the PSP
Keywords: open file limit PSP
Message-ID: <1350@proa.es>
Date: 10 Aug 92 11:55:02 GMT
References: <1992Aug4.191805.25912@tamsun.tamu.edu>
Reply-To: alberto@proa.es (Alberto Poblacion)
Organization: PROA - Compugraf,S.A. MADRID Spain
Lines: 45