thr_stksegment(3T)
NAME
thr_stksegment − get thread stack bottom and stack size
SYNOPSIS
cc [ flag ... ] file ... −lthread [ library ... ]
#include <thread.h>
#include <sys/signal.h>
int thr_stksegment(stack_t∗)
MT-LEVEL
MT-Safe
DESCRIPTION
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().
RETURN VALUES
thr_stksegment() returns 0 if both the thread stack bottom and stack size were successfully retrieved; otherwise, it returns a non-zero error code.
ERRORS
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.
SEE ALSO
SunOS 5.5 — Last change: 21 Sep 1995