Merge commit 'b31320a79e2054c6739b5229259dbf98f3afc547' into merges
[unleashed.git] / share / man / man2 / getustack.2
blob6e2918e73e58dfec093fca725c99b43141cb7b7b
1 '\" te
2 .\" Copyright (c) 2004, 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 GETUSTACK 2 "Nov 2, 2004"
7 .SH NAME
8 getustack, setustack \- retrieve or change the address of per-LWP stack
9 boundary information
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <ucontext.h>
15 \fBint\fR \fBgetustack\fR(\fBstack_t **\fR\fIspp\fR);
16 .fi
18 .LP
19 .nf
20 \fBint\fR \fBsetustack\fR(\fBstack_t *\fR\fIsp\fR);
21 .fi
23 .SH DESCRIPTION
24 .sp
25 .LP
26 The \fBgetustack()\fR function retrieves the address of per-LWP stack boundary
27 information.  The address is stored at the location pointed to by \fIspp\fR. If
28 this address has not been defined using a previous call to \fBsetustack()\fR,
29 \fINULL\fR is stored at the location pointed to by \fIspp\fR.
30 .sp
31 .LP
32 The \fBsetustack()\fR function changes the address of the current thread's
33 stack boundary information to the value of \fIsp\fR.
34 .SH RETURN VALUES
35 .sp
36 .LP
37 Upon successful completion, these functions return 0. Otherwise, \(mi1 is
38 returned and \fBerrno\fR is set to indicate the error.
39 .SH ERRORS
40 .sp
41 .LP
42 These functions will fail if:
43 .sp
44 .ne 2
45 .na
46 \fB\fBEFAULT\fR\fR
47 .ad
48 .RS 10n
49 The \fIspp\fR or \fIsp\fR argument does not refer to a valid address.
50 .RE
52 .SH USAGE
53 .sp
54 .LP
55 Only implementors of custom threading libraries should use these functions to
56 get and set the address of the stack bound to an internal per-thread data
57 structure. Other users should use \fBstack_getbounds\fR(3C) and
58 \fBstack_setbounds\fR(3C).
59 .SH ATTRIBUTES
60 .sp
61 .LP
62 See \fBattributes\fR(5) for descriptions of the following attributes:
63 .sp
65 .sp
66 .TS
67 box;
68 c | c
69 l | l .
70 ATTRIBUTE TYPE  ATTRIBUTE VALUE
72 Interface Stability     Evolving
74 MT-Level        Async-Signal-Safe
75 .TE
77 .SH SEE ALSO
78 .sp
79 .LP
80 \fB_stack_grow\fR(3C), \fBstack_getbounds\fR(3C), \fBstack_inbounds\fR(3C),
81 \fBstack_setbounds\fR(3C), \fBstack_violation\fR(3C), \fBattributes\fR(5)