[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    thr_stksegment(3T) manual page Table of Contents

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

thr_create(3T)


Table of Contents