2 .\" Copyright (c) 2000 Sun Microsystems, Inc. - All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH THR_STKSEGMENT 3C "Jun 15, 2000"
8 thr_stksegment \- get thread stack address and size
12 cc -mt [ \fIflag\fR... ] \fIfile\fR...[ \fIlibrary\fR... ]
16 \fBint\fR \fBthr_stksegment\fR(\fBstack_t *\fR\fIss\fR);
22 The \fBthr_stksegment()\fR function returns, in its \fBstack_t\fR argument, the
23 address and size of the calling thread's stack.
26 The \fBstack_t\fR structure includes the following members:
38 On successful return from \fBthr_stksegment()\fR, \fBss_sp\fR contains the high
39 address of the caller's stack and \fBss_size\fR contains the size of the stack
40 in bytes. The \fBss_flags\fR member is always 0. Note that the meaning of
41 \fBss_sp\fR is reversed from other uses of \fBstack_t\fR such as
42 \fBsigaltstack\fR(2) where \fBss_sp\fR is the low address.
45 The stack information provided by \fBthr_stksegment()\fR is typically used by
46 debuggers, garbage collectors, and similar applications. Most applications
47 should not require such information.
51 The \fBthr_stksegment()\fR function returns \fB0\fR if the thread stack
52 address and size were successfully retrieved. Otherwise, it returns a non-zero
57 The \fBthr_stksegment()\fR function will fail if:
64 The stack information for the thread is not available because the thread's
65 initialization is not yet complete, or the thread is an internal thread.
71 See \fBattributes\fR(5) for descriptions of the following attributes:
79 ATTRIBUTE TYPE ATTRIBUTE VALUE
87 \fBsigaltstack\fR(2), \fBthr_create\fR(3C), \fBattributes\fR(5)