The information in this article applies to:
SUMMARYThe Microsoft C Run-time functions exec() and spawn() with P_OVERLAY ignore the maximum memory allocation information in the .EXE file header. If you exec or spawn with P_OVERLAY, a program whose maximum allocation is set equal to the minimum allocation (through EXEMOD or the LINK option /CP:1), the program is allocated the full 64K DGROUP. MORE INFORMATION
The effective maximum allocation for any exec'ed (or spawn'ed with
P_OVERLAY) program is 0xffff (whatever MS-DOS has available),
regardless of the maximum allocation number in the program's .EXE
header. When run from the MS-DOS prompt, the maximum allocation
information of the same program is honored. AlternativesInstead of calling a program with exec() or spawn() with P_OVERLAY, call COMMAND.COM with the desired child program as an argument using exec() or spawn() with P_OVERLAY, as follows:
COMMAND.COM then loads your application as if it was from the MS-DOS
prompt. Note, however, that the COMMAND.COM shell itself requires
approximately 4K. Also, consecutive exec() or spawn() with P_OVERLAY
calls using this method run additional shells of COMMAND.COM,
accumulating one 4K shell per generation, as illustrated below:
Another option is to call your program with the system() function, but
this does not overlay the child process.
Additional query words: 1.00 1.50 6.00 6.00a 6.00ax 7.00 kbinf execl execle execlp execlpe execcv execve execvp execvpe spawnl spawnle spawnlp spawnlpe spawnv spawnve spawnvp spawnvpe
Keywords : kb16bitonly |
Last Reviewed: January 4, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |