thr_stksegment(3T) manual page
Table of Contents
thr_stksegment - get thread stack bottom and stack size
cc
[ flag ... ] file ... -lthread [ library ... ]
#include <thread.h>
#include <sys/signal.h>
int thr_stksegment(stack_t*)
MT-Safe
The stack information
provided by thr_stksegment() is typically used by debuggers, garbage collectors,
and similar applications. Most applications should not require such information.
The bottom of the thread stack returned by thr_stksegment() points to
a part of the stack which may contain data maintained by libthread. The
user’s thread stack starts at a point below the bottom of the stack as returned
by thr_stksegment().
thr_stksegment() returns 0 if both the
thread stack bottom and stack size were successfully retrieved; otherwise,
it returns a non-zero error code.
If any of the following conditions
are detected, thr_stksegment() fails and returns the corresponding value:
- EFAULT
- A system call used to get the stack information failed because
a bad address was passed to it.
- EAGAIN
- The stack information for the thread
is not available because the thread’s initialization is not yet complete,
or the thread is an internal thread.
thr_create(3T)
Table of Contents