Thread View: comp.os.msdos.programmer
1 messages
1 total messages
Started by Mark Becker
Fri, 03 Aug 1990 01:23
Need help with Turbo-C 2.0 spawnl() function.
Author: Mark Becker
Date: Fri, 03 Aug 1990 01:23
Date: Fri, 03 Aug 1990 01:23
46 lines
2058 bytes
2058 bytes
Hello *
Need a little help with the care and feeding of Borland's Turbo-C 2.0
spawnl() function. I think I'm doing something incorrect but after
Reading The Fine Manual I can't seem to spot it.
The following standalone program works fine:
#include <process.h>
#include <stdio.h>
#include <stdlib.h>
void fragment(void)
{ char *p;
if ((p = getenv("COMSPEC")) == NULL) return;
if (spawnl(P_WAIT, p, p, NULL) == -1) perror(p);
}
void main(void) { fragment();}
However, when fragment() is integrated into a somewhat larger program
(small model) I get Stack Overflow messages, followed by an eventual
stack 'roll-over' failure with a message out of the BIOS in this
386-clone. This requires the Small Red Button (reset) to regain
control.
Not quite believing the situation, I re-compiled using compact model.
This time I get a message out of COMMAND.COM about how there isn't
enough memory. At least it doesn't crash the machine.
The larger program in small model is something like 30K of .EXE with
easily 400K of free memory to run in and isn't memory intensive; a
fancy device controller with a "Shell" option in the software.
This whole thing is running on a 'vanilla' DOS 3.21 system with CHKDSK
reporting 606,480 bytes of available memory.
COMMAND.COM is 'only' 23,612 bytes. Where is all that memory going?
Your help appreciated.
Regards,
Mark
+-----------------------------------------------+-----------------------+
| Mark Becker | .signature under |
| Internet: mbeck@ai.mit.edu | construction |
+-----------------------------------------------+-----------------------+
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads