1pthread_attr_setstackaddr(3)Library Functions Manualpthread_attr_setstackaddr(3)
2
3
4
6 pthread_attr_setstackaddr, pthread_attr_getstackaddr - set/get stack
7 address attribute in thread attributes object
8
10 POSIX threads library (libpthread, -lpthread)
11
13 #include <pthread.h>
14
15 [[deprecated]]
16 int pthread_attr_setstackaddr(pthread_attr_t *attr, void *stackaddr);
17 [[deprecated]]
18 int pthread_attr_getstackaddr(const pthread_attr_t *restrict attr,
19 void **restrict stackaddr);
20
22 These functions are obsolete: do not use them. Use pthread_attr_set‐
23 stack(3) and pthread_attr_getstack(3) instead.
24
25 The pthread_attr_setstackaddr() function sets the stack address attri‐
26 bute of the thread attributes object referred to by attr to the value
27 specified in stackaddr. This attribute specifies the location of the
28 stack that should be used by a thread that is created using the thread
29 attributes object attr.
30
31 stackaddr should point to a buffer of at least PTHREAD_STACK_MIN bytes
32 that was allocated by the caller. The pages of the allocated buffer
33 should be both readable and writable.
34
35 The pthread_attr_getstackaddr() function returns the stack address at‐
36 tribute of the thread attributes object referred to by attr in the buf‐
37 fer pointed to by stackaddr.
38
40 On success, these functions return 0; on error, they return a nonzero
41 error number.
42
44 No errors are defined (but applications should nevertheless handle a
45 possible error return).
46
48 For an explanation of the terms used in this section, see at‐
49 tributes(7).
50
51 ┌────────────────────────────────────────────┬───────────────┬─────────┐
52 │Interface │ Attribute │ Value │
53 ├────────────────────────────────────────────┼───────────────┼─────────┤
54 │pthread_attr_setstackaddr(), │ Thread safety │ MT-Safe │
55 │pthread_attr_getstackaddr() │ │ │
56 └────────────────────────────────────────────┴───────────────┴─────────┘
57
59 None.
60
62 glibc 2.1. Marked obsolete in POSIX.1-2001. Removed in POSIX.1-2008.
63
65 Do not use these functions! They cannot be portably used, since they
66 provide no way of specifying the direction of growth or the range of
67 the stack. For example, on architectures with a stack that grows
68 downward, stackaddr specifies the next address past the highest address
69 of the allocated stack area. However, on architectures with a stack
70 that grows upward, stackaddr specifies the lowest address in the
71 allocated stack area. By contrast, the stackaddr used by
72 pthread_attr_setstack(3) and pthread_attr_getstack(3), is always a
73 pointer to the lowest address in the allocated stack area (and the
74 stacksize argument specifies the range of the stack).
75
77 pthread_attr_init(3), pthread_attr_setstack(3),
78 pthread_attr_setstacksize(3), pthread_create(3), pthreads(7)
79
80
81
82Linux man-pages 6.05 2023-07-20 pthread_attr_setstackaddr(3)