Print this page
8158 Want named threads API
9857 proc manpages should have LIBRARY section
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3proc/Plwp_stack.3proc
+++ new/usr/src/man/man3proc/Plwp_stack.3proc
1 1 .\"
2 2 .\" This file and its contents are supplied under the terms of the
3 3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 4 .\" You may only use this file in accordance with the terms of version
5 5 .\" 1.0 of the CDDL.
6 6 .\"
7 7 .\" A full copy of the text of the CDDL should have accompanied this
8 8 .\" source. A copy of the CDDL is also available via the Internet at
9 9 .\" http://www.illumos.org/license/CDDL.
10 10 .\"
11 11 .\"
12 12 .\" Copyright 2015 Joyent, Inc.
13 13 .\"
14 14 .Dd May 11, 2016
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 .Dt PLWP_STACK 3PROC
16 16 .Os
17 17 .Sh NAME
18 18 .Nm Plwp_stack ,
19 19 .Nm Plwp_alt_stack ,
20 20 .Nm Plwp_main_stack ,
21 21 .Nm Lstack ,
22 22 .Nm Lalt_stack ,
23 23 .Nm Lmain_stack
24 24 .Nd get thread stack information
25 -.Sh SYNOPSIS
25 +.Sh LIBRARY
26 26 .Lb libproc
27 +.Sh SYNOPSIS
27 28 .In libproc.h
28 29 .Ft int
29 30 .Fo Plwp_stack
30 31 .Fa "struct ps_prochandle *P"
31 32 .Fa "lwpid_t lwpid"
32 33 .Fa "stack_t *stkp"
33 34 .Fc
34 35 .Ft int
35 36 .Fo Plwp_alt_stack
36 37 .Fa "struct ps_prochandle *P"
37 38 .Fa "lwpid_t lwpid"
38 39 .Fa "stack_t *stkp"
39 40 .Fc
40 41 .Ft int
41 42 .Fo Plwp_main_stack
42 43 .Fa "struct ps_prochandle *P"
43 44 .Fa "lwpid_t lwpid"
44 45 .Fa "stack_t *stkp"
45 46 .Fc
46 47 .Ft int
47 48 .Fo Lalt_stack
48 49 .Fa "struct ps_lwphandle *L"
49 50 .Fa "stack_t *stkp"
50 51 .Fc
51 52 .Ft int
52 53 .Fo Lmain_stack
53 54 .Fa "struct ps_lwphandle *L"
54 55 .Fa "stack_t *stkp"
55 56 .Fc
56 57 .Ft int
57 58 .Fo Lstack
58 59 .Fa "struct ps_lwphandle *L"
59 60 .Fa "stack_t *stkp"
60 61 .Fc
61 62 .Sh DESCRIPTION
62 63 The
63 64 .Fn Plwp_stack ,
64 65 .Fn Plwp_alt_stack ,
65 66 and
66 67 .Fn Plwp_main_stack
67 68 functions obtain information about the size and address of the stacks
68 69 for the thread identified by
69 70 .Fa lwpid
70 71 in the process handle
71 72 .Fa P .
72 73 .Pp
73 74 Each thread in a process has its own stack which is used both for
74 75 maintaining function call sequences and the storing of local variables.
75 76 A thread may also configure a different stack to handle specific
76 77 signals.
77 78 This stack is often called the
78 79 .Em alternate stack .
79 80 Whether or not the alternate stack is used may be controlled through the
80 81 .Xr sigaction 2
81 82 and
82 83 .Xr sigaltstack 2
83 84 functions .
84 85 .Pp
85 86 The
86 87 .Fn Plwp_stack
87 88 function fills in
88 89 .Fa stkp
89 90 with the information about the thread's currently executing stack,
90 91 whether the alternate or main one.
91 92 .Pp
92 93 The
93 94 .Fn Plwp_alt_stack
94 95 function fills in
95 96 .Fa stkp
96 97 with the information about the thread's alternate stack, if it's
97 98 configured.
98 99 .Pp
99 100 The
100 101 .Fn Plwp_main_stack
101 102 function fills in
102 103 .Fa stkp
103 104 with the information about the thread's main stack, regardless of if there
104 105 is an alternate stack or it is executing one.
105 106 .Pp
106 107 Process handles that refer to files, obtained through
107 108 .Xr Pgrab_file 3PROC ,
108 109 do not have any stack information and these functions will always fail
109 110 on them.
110 111 .Pp
111 112 The
112 113 .Fn Lalt_stack ,
113 114 .Fn Lmain_stack ,
114 115 and
115 116 .Fn Lstack
116 117 functions are identical to the
117 118 .Fn Plwp_alt_stack ,
118 119 .Fn Plwp_main_stack ,
119 120 and
120 121 .Fn Plwp_main_stack
121 122 functions, except rather than specifying a thread to operate on, they
122 123 operate on the thread handle
123 124 .Fa L ,
124 125 which specifies the thread to operate on.
125 126 .Sh RETURN VALUES
126 127 Upon successful completion, the
127 128 .Fn Plwp_stack ,
128 129 .Fn Plwp_alt_stack ,
129 130 .Fn Plwp_main_stack ,
130 131 .Fn Lalt_stack ,
131 132 .Fn Lmain_stack ,
132 133 and
133 134 .Fn Lstack
134 135 functions return
135 136 .Sy 0
136 137 and fills in
137 138 .Fa stkp
138 139 with information about the appropriate stack.
139 140 Otherwise,
140 141 .Sy -1
141 142 is returned,
142 143 .Sy errno
143 144 is updated with the error, and
144 145 .Fa stkp
145 146 is not modified.
146 147 .Sh ERRORS
147 148 For a full list of possible errors also see the
148 149 .Sy DIAGNOSTICS
149 150 section in
150 151 .Xr proc 4 .
151 152 .Pp
152 153 The
153 154 .Fn Plwp_stack ,
154 155 .Fn Plwp_alt_stack ,
155 156 and
156 157 .Fn Plwp_main_stack
157 158 function will fail if:
158 159 .Bl -tag -width Er
159 160 .It Er ENODATA
160 161 The process handle
161 162 .Fa P
162 163 refers to a grabbed file, not an active process or core.
163 164 .It Er EINVAL
164 165 The process handle
165 166 .Fa P
166 167 refers to a core file and the specified thread does not exist.
167 168 .It Er ENOENT
168 169 The process handle
169 170 .Fa P
170 171 refers to an active process and the specified thread does not exist.
171 172 .El
172 173 .Pp
173 174 The
174 175 .Fn Plwp_alt_stack
175 176 and
176 177 .Fn Lalt_stack
177 178 functions will fail if:
178 179 .Bl -tag -width Er
179 180 .It Er ENODATA
180 181 The thread identified by
181 182 .Fa lwpid
182 183 did not have an alternate stack enabled.
183 184 .El
184 185 .Sh INTERFACE STABILITY
185 186 .Sy Uncommitted
186 187 .Sh MT-LEVEL
187 188 See
188 189 .Sy LOCKING
189 190 in
190 191 .Xr libproc 3LIB .
191 192 .Sh SEE ALSO
192 193 .Xr sigaction 2 ,
193 194 .Xr sigaltstack 2 ,
194 195 .Xr libproc 3LIB ,
195 196 .Xr proc 4
↓ open down ↓ |
159 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX