🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

SetHandleCount + Child Processes

#4
From: |S| Uwe Grensing
Date: Tue, 27 Oct 1992 09:38
21 lines
1718 bytes
I think I found a bug in the MS-DOS EXEC function (4Bh). When spawning from a
parent process which increased handle count by using function 67h under MS-DOS
5.0, the file alias table in the child's psp contains the first 20 filehandles
of the parent process. If the parent process had opened more than 20 files at
that time, opening a file from the child process will fail (and the child
process might crash). Calling 67h from the child process to increase its handle
count is a sure way to lock your machine, so you do not get access to any of
the parent's files with a handle > 20.

One possible solution is to open (nearly) all of the parent's files with the
O_NOINHERIT flag (at least with ZORTECH C++ 3.0), so a child process gets an
empty files alias table. This worked fine to solve my specific problem, but
does anyone know of a workaround which permits to access file handles > 20 and
open more than 20 files in child process ?

------------------------------------------------------------------------------
Uwe Grensing
Internet: S_GRENSING@iravcl.ira.uka.de
Bitnet: UKDX@DKAUNI2.BITNET
------------------------------------------------------------------------------
   
Technical Details
Message-ID: <1cj2muINN9qh@iraul1.ira.uka.de>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!usc!wupost!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!uka!uka!news

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!usc!wupost!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!uka!uka!news
From: S_GRENSING@iravcl.ira.uka.de (|S| Uwe Grensing)
Newsgroups: comp.os.msdos.programmer
Subject: SetHandleCount + Child Processes
Date: 27 Oct 1992 09:38:38 GMT
Organization: University of Karlsruhe (FRG) - Informatik Rechnerabt.
Lines: 21
Distribution: world
Message-ID: <1cj2muINN9qh@iraul1.ira.uka.de>
NNTP-Posting-Host: irav1.ira.uka.de
X-News-Reader: VMS NEWS 1.23