Article View: comp.sys.ibm.pc.programmer
Article #252Dos function 4Bh without using spawn() in C
From: Richard Brittain
Date: Sun, 08 Apr 1990 07:39
Date: Sun, 08 Apr 1990 07:39
26 lines
2061 bytes
2061 bytes
Hi,
I'm wondering if anyone has tried to "roll their own" spawn() with
TC. I am trying to minimise the resident code after running a child program,
and spawn() links in a bunch of stuff I don't need, and adds over 2k - mostly
dealing with setting up the FCB structures on the offchance that some archaic
program still needs them. I have a working version, setting up the parameter
blocks, pointing the registers in the right places and calling function 4Bh,
but it seems to be very flaky. A rather high percentage of the programs I
try to run this way cause a crash (4B returns error code 8 - not enough memory
and the MCB structure is wrecked so that any future attempt to allocate or
deallocate memory locks up the machine). When I have one that works, it at
least works consistently. There is never really not enough memory.
So, does anyone have any experience of "gotchas" using this function, which
presumable the spawn() library code works around? I already figured out
that the command line has to begin with a space or DOS is very unhappy, and
it seems to like a trailing space also.
I am sticking null pointers in for the address of the FCB's which DOS puts
in the PSP of the child, since I know they will not be used. It seems to
behave just the same if I actually stick empty FCB's in though.
thanks
Richard Brittain, School of Elect. Eng., Upson Hall
Cornell University, Ithaca, NY 14853
ARPA: richard@calvin.spp.cornell.edu
UUCP: {uunet,uw-beaver,rochester,cmcl2}!cornell!calvin!richard
Technical Details
Message-ID:
<1990Apr8.073952.5936@calvin.spp.cornell.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cornell!calvin.spp.cornell.edu!richardShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cornell!calvin.spp.cornell.edu!richard From: richard@calvin.spp.cornell.edu (Richard Brittain) Newsgroups: comp.sys.ibm.pc.programmer Subject: Dos function 4Bh without using spawn() in C Message-ID: <1990Apr8.073952.5936@calvin.spp.cornell.edu> Date: 8 Apr 90 07:39:52 GMT Reply-To: richard@calvin.spp.cornell.edu.UUCP (Richard Brittain) Organization: Cornell Space Plasma Physics Group Lines: 26