1pthread_attr_setstackaddr(3)Library Functions Manualpthread_attr_setstackaddr(3)
2
3
4

NAME

6       pthread_attr_setstackaddr,  pthread_attr_getstackaddr  -  set/get stack
7       address attribute in thread attributes object
8

LIBRARY

10       POSIX threads library (libpthread, -lpthread)
11

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

40       On  success,  these functions return 0; on error, they return a nonzero
41       error number.
42

ERRORS

44       No errors are defined (but applications should  nevertheless  handle  a
45       possible error return).
46

ATTRIBUTES

48       For  an  explanation  of  the  terms  used  in  this  section,  see at‐
49       tributes(7).
50
51       ┌────────────────────────────────────────────┬───────────────┬─────────┐
52Interface                                   Attribute     Value   
53       ├────────────────────────────────────────────┼───────────────┼─────────┤
54pthread_attr_setstackaddr(),                │ Thread safety │ MT-Safe │
55pthread_attr_getstackaddr()                 │               │         │
56       └────────────────────────────────────────────┴───────────────┴─────────┘
57

STANDARDS

59       None.
60

HISTORY

62       glibc 2.1.  Marked obsolete in POSIX.1-2001.  Removed in POSIX.1-2008.
63

NOTES

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 down‐
68       ward, stackaddr specifies the next address past the highest address  of
69       the  allocated stack area.  However, on architectures with a stack that
70       grows upward, stackaddr specifies the lowest address in  the  allocated
71       stack  area.   By  contrast,  the  stackaddr  used by pthread_attr_set‐
72       stack(3) and pthread_attr_getstack(3), is always a pointer to the  low‐
73       est  address  in  the  allocated stack area (and the stacksize argument
74       specifies the range of the stack).
75

SEE ALSO

77       pthread_attr_init(3), pthread_attr_setstack(3),  pthread_attr_setstack‐
78       size(3), pthread_create(3), pthreads(7)
79
80
81
82Linux man-pages 6.04              2023-03-30      pthread_attr_setstackaddr(3)
Impressum