_stklen in Turbo C

Martin vdBoogaard boogaard at ruunsa.fys.ruu.nl
Wed Feb 6 04:36:25 AEST 1991


For a variety of reasons I'd like to be able to compile (on a DOS machine
with Turbo C) with a stack that is larger than the usual 4kB. The manual
(yes, I *have* read the FM) says I should simply set _stklen (defined in
dos.h) to the desired value. I just can't find out where. If I put e.g.

  _stklen = 10000;

at the start of main (), nothing happens, i.e. when I deliberately cause
a stack overflow by some silly recursion, the number of times my
stack-consuming function can call itself before triggering the `Stack
overflow!' run-time error is always the same. (I can even make _stklen 0
if I like.) Actually, I don't understand how a program would be able to
change its own stack size at run time. Is this really what happens (or,
in my case, doesn't happen)? Who has a working example of how to do this?


Thanks,

Martin J. van den Boogaard         | Dept. of Atomic & Interface Physics
                                   | Debye Institute--Utrecht University
boogaard at fys.ruu.nl                | P.O. Box 80.000, NL-3508 TA Utrecht
boogaard at hutruu51.bitnet           | the Netherlands, +31 30 532904
------------------------------------------------------------------------



More information about the Comp.lang.c mailing list