This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / Wish experts answer my questions in c programming under Unix in a real time system: Thanks! 1. how to enlarge the stack size in a c program? 2. should main() be the driver function in in a c program?
-guest:anne;
2001-4-24
(#52456@0)
-
explain your questions in more detail. Your questions are too generic to be understood.
-guest:;
2001-4-24
(#52546@0)
-
the stack is assigned during a *.c file compiled and loading into system.
a executable file contains: symbol table,global variables, program code.
so how a programmer enlarge the stack used by the *.c application?
-guest:anne;
2001-4-24
(#52603@0)
-
you mean that *.c program running separately as a standalone process and your own application needs to enlarge the stack it uses. I guess you don't have the source code for the *.c program, right?
-guest:;
2001-4-24
(#52607@0)
-
What you describ is correct. As for the code, I read it. A big array is used as a stack and the stack pointer moved to the bottom of such array at the very beginning of the .c program.
-guest:Anne;
2001-4-25
(#53070@0)
-
oh, I see , you are talking about Unix , not RTOSIf you want to change user process stack size, use ulimit shell command to modify it(ulimi -s). As for kernel, there is no easy way to change it... emmm... maybe you can try to modify /etc/system, which is a file that configures kernel parameter upon boot, but be careful, you might make your unix box unbootable.
-numnum(numnum);
2001-4-24
{313}
(#52621@0)
-
the space of stack is decided by linkercheck ur link program's man page to see the option
-blaise(blaise);
2001-5-15
{51}
(#70908@0)
-
so the stack can not be enlarged in the program?
-guest:anne;
2001-5-17
(#72995@0)
-
some trick can do so, but not recomanded
-blaise(blaise);
2001-5-17
(#73002@0)