1PTHREAD_ATTR_SETSTACKADDR(3)Linux Programmer's ManuaPlTHREAD_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

SYNOPSIS

10       #include <pthread.h>
11
12       int pthread_attr_setstackaddr(pthread_attr_t *attr, void *stackaddr);
13       int pthread_attr_getstackaddr(pthread_attr_t *attr, void **stackaddr);
14
15       Compile and link with -pthread.
16

DESCRIPTION

18       These functions are obsolete: do not use them.   Use  pthread_attr_set‐
19       stack(3) and pthread_attr_getstack(3) instead.
20
21       The   pthread_attr_setstackaddr()   function  sets  the  stack  address
22       attribute of the thread attributes object referred to by  attr  to  the
23       value specified in stackaddr.  This attribute specifies the location of
24       the stack that should be used by a thread that  is  created  using  the
25       thread attributes object attr.
26
27       stackaddr  should point to a buffer of at least PTHREAD_STACK_MIN bytes
28       that was allocated by the caller.  The pages of  the  allocated  buffer
29       should be both readable and writable.
30
31       The  pthread_attr_getstackaddr()  function  returns  the  stack address
32       attribute of the thread attributes object referred to by  attr  in  the
33       buffer pointed to by stackaddr.
34

RETURN VALUE

36       On  success, these functions return 0; on error, they return a non-zero
37       error number.
38

ERRORS

40       No errors are defined (but applications should  nevertheless  handle  a
41       possible error return).
42

VERSIONS

44       These functions are provided by glibc since version 2.1.
45

CONFORMING TO

47       POSIX.1-2001  specifies  these  functions  but  marks them as obsolete.
48       POSIX.1-2008 removes the specification of these functions.
49

NOTES

51       Do not use these functions!  They cannot be portably used,  since  they
52       provide  no  way  of specifying the direction of growth or the range of
53       the stack.  For example, on architectures with a stack that grows down‐
54       wards, stackaddr specifies the next address past the highest address of
55       the allocated stack area.  However, on architectures with a stack  that
56       grows  upwards, stackaddr specifies the lowest address in the allocated
57       stack area.  By  contrast,  the  stackaddr  used  by  pthread_attr_set‐
58       stack(3)  and pthread_attr_getstack(3), is always a pointer to the low‐
59       est address in the allocated stack area  (and  the  stacksize  argument
60       specifies the range of the stack).
61

SEE ALSO

63       pthread_attr_init(3),  pthread_attr_setstack(3), pthread_attr_setstack‐
64       size(3), pthread_create(3), pthreads(7)
65

COLOPHON

67       This page is part of release 3.22 of the Linux  man-pages  project.   A
68       description  of  the project, and information about reporting bugs, can
69       be found at http://www.kernel.org/doc/man-pages/.
70
71
72
73Linux                             2008-10-24      PTHREAD_ATTR_SETSTACKADDR(3)
Impressum