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.man.txt
+++ new/usr/src/man/man3proc/Plwp_stack.3proc.man.txt
1 1 PLWP_STACK(3PROC) Process Control Library Functions PLWP_STACK(3PROC)
2 2
3 3 NAME
4 4 Plwp_stack, Plwp_alt_stack, Plwp_main_stack, Lstack, Lalt_stack,
5 5 Lmain_stack - get thread stack information
6 6
7 -SYNOPSIS
7 +LIBRARY
8 8 Process Control Library (libproc, -lproc)
9 +
10 +SYNOPSIS
9 11 #include <libproc.h>
10 12
11 13 int
12 14 Plwp_stack(struct ps_prochandle *P, lwpid_t lwpid, stack_t *stkp);
13 15
14 16 int
15 17 Plwp_alt_stack(struct ps_prochandle *P, lwpid_t lwpid, stack_t *stkp);
16 18
17 19 int
18 20 Plwp_main_stack(struct ps_prochandle *P, lwpid_t lwpid, stack_t *stkp);
19 21
20 22 int
21 23 Lalt_stack(struct ps_lwphandle *L, stack_t *stkp);
22 24
23 25 int
24 26 Lmain_stack(struct ps_lwphandle *L, stack_t *stkp);
25 27
26 28 int
27 29 Lstack(struct ps_lwphandle *L, stack_t *stkp);
28 30
29 31 DESCRIPTION
30 32 The Plwp_stack(), Plwp_alt_stack(), and Plwp_main_stack() functions
31 33 obtain information about the size and address of the stacks for the
32 34 thread identified by lwpid in the process handle P.
33 35
34 36 Each thread in a process has its own stack which is used both for
35 37 maintaining function call sequences and the storing of local variables.
36 38 A thread may also configure a different stack to handle specific signals.
37 39 This stack is often called the alternate stack. Whether or not the
38 40 alternate stack is used may be controlled through the sigaction(2) and
39 41 sigaltstack(2) functions .
40 42
41 43 The Plwp_stack() function fills in stkp with the information about the
42 44 thread's currently executing stack, whether the alternate or main one.
43 45
44 46 The Plwp_alt_stack() function fills in stkp with the information about
45 47 the thread's alternate stack, if it's configured.
46 48
47 49 The Plwp_main_stack() function fills in stkp with the information about
48 50 the thread's main stack, regardless of if there is an alternate stack or
49 51 it is executing one.
50 52
51 53 Process handles that refer to files, obtained through Pgrab_file(3PROC),
52 54 do not have any stack information and these functions will always fail on
53 55 them.
54 56
55 57 The Lalt_stack(), Lmain_stack(), and Lstack() functions are identical to
56 58 the Plwp_alt_stack(), Plwp_main_stack(), and Plwp_main_stack() functions,
57 59 except rather than specifying a thread to operate on, they operate on the
58 60 thread handle L, which specifies the thread to operate on.
59 61
60 62 RETURN VALUES
61 63 Upon successful completion, the Plwp_stack(), Plwp_alt_stack(),
62 64 Plwp_main_stack(), Lalt_stack(), Lmain_stack(), and Lstack() functions
63 65 return 0 and fills in stkp with information about the appropriate stack.
64 66 Otherwise, -1 is returned, errno is updated with the error, and stkp is
65 67 not modified.
66 68
67 69 ERRORS
68 70 For a full list of possible errors also see the DIAGNOSTICS section in
69 71 proc(4).
70 72
71 73 The Plwp_stack(), Plwp_alt_stack(), and Plwp_main_stack() function will
72 74 fail if:
73 75
74 76 ENODATA The process handle P refers to a grabbed file, not an
75 77 active process or core.
76 78
77 79 EINVAL The process handle P refers to a core file and the
78 80 specified thread does not exist.
79 81
80 82 ENOENT The process handle P refers to an active process and
81 83 the specified thread does not exist.
82 84
83 85 The Plwp_alt_stack() and Lalt_stack() functions will fail if:
84 86
85 87 ENODATA The thread identified by lwpid did not have an
86 88 alternate stack enabled.
87 89
88 90 INTERFACE STABILITY
89 91 Uncommitted
90 92
91 93 MT-LEVEL
92 94 See LOCKING in libproc(3LIB).
93 95
94 96 SEE ALSO
95 97 sigaction(2), sigaltstack(2), libproc(3LIB), proc(4)
96 98
97 99 illumos May 11, 2016 illumos
↓ open down ↓ |
79 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX