1thr_stksegment(3C) Standard C Library Functions thr_stksegment(3C)
2
3
4
6 thr_stksegment - get thread stack address and size
7
9 cc -mt [ flag... ] file...[ library... ]
10 #include <thread.h>
11 #include <signal.h>
12
13 int thr_stksegment(stack_t *ss);
14
15
17 The thr_stksegment() function returns, in its stack_t argument, the
18 address and size of the calling thread's stack.
19
20
21 The stack_t structure includes the following members:
22
23 void *ss_sp
24 size_t ss_size
25 int ss_flags
26
27
28
29 On successful return from thr_stksegment(), ss_sp contains the high
30 address of the caller's stack and ss_size contains the size of the
31 stack in bytes. The ss_flags member is always 0. Note that the meaning
32 of ss_sp is reversed from other uses of stack_t such as sigaltstack(2)
33 where ss_sp is the low address.
34
35
36 The stack information provided by thr_stksegment() is typically used by
37 debuggers, garbage collectors, and similar applications. Most applica‐
38 tions should not require such information.
39
41 The thr_stksegment() function returns 0 if the thread stack address
42 and size were successfully retrieved. Otherwise, it returns a non-zero
43 error value.
44
46 The thr_stksegment() function will fail if:
47
48 EAGAIN The stack information for the thread is not available
49 because the thread's initialization is not yet complete, or
50 the thread is an internal thread.
51
52
54 See attributes(5) for descriptions of the following attributes:
55
56
57
58
59 ┌─────────────────────────────┬─────────────────────────────┐
60 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
61 ├─────────────────────────────┼─────────────────────────────┤
62 │MT-Level │MT-Safe │
63 └─────────────────────────────┴─────────────────────────────┘
64
66 sigaltstack(2), thr_create(3C), attributes(5)
67
68
69
70SunOS 5.11 15 Jun 2000 thr_stksegment(3C)