The thr_stksegment() function returns, in its stack_t argument, the address and size of the calling thread's stack.
The stack_t structure includes the following members:
|
void *ss_sp
size_t ss_size
int ss_flags
|
On successful return from thr_stksegment(), ss_sp contains the high address of the caller's stack and ss_size contains the size of the stack in bytes. The ss_flags member is always 0. Note that the meaning of ss_sp is reversed from other uses of stack_t such as sigaltstack(2) where ss_sp is the low address.
The stack information provided by thr_stksegment() is typically used by debuggers, garbage collectors, and similar applications. Most applications should not require such information.
|