How to get current stack usage
Hi all,
I'm programming in Linux, is there any way to get current stack usage of a thread (it's stack usage, not the stack size), means that how much stack space that all local variables, function return addresses, etc. use at a the moment? Sorry for my bad English. Any help would be appreciated. -- phuna |
What language are you scripting/programming this in? Might help.
|
Thanks for your reply, I'm using C
|
The only available system call is getrusage().
It may not give you what you need, but it will indicate if you are near to crashing into limits. |
I've tried getrusage, but it returns zero for stack usage!
Code:
#include <sys/time.h> |
All times are GMT -5. The time now is 11:26 AM. |