Muli Ben-Yehuda wrote:

Ah, good point. I don't believe this is explicitly tracked, since the
stack segment grows automatically. Here's how I would do it, assuming
you can run code in the context of that thread: get the base of the
stack (initial address) using pthread_attr_getstackaddr or
pthread_attr_getstack, get the current value of the stack pointer via
inline assembly or just creating a variable on the stack and taking
its address, and then substract the former from the latter. Take into
account that the stack may grow up or down, depending on
architecture. The value you get back is the current size of the stack.
inline assembly was a good idea :)

10x,
Mike


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to