1PTHREAD_ATTR_GETSTACKADDR(3PP)OSIX Programmer's ManuPaTlHREAD_ATTR_GETSTACKADDR(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       pthread_attr_getstackaddr, pthread_attr_setstackaddr - get and set  the
13       stackaddr attribute
14

SYNOPSIS

16       #include <pthread.h>
17
18
19
20       int pthread_attr_getstackaddr(const pthread_attr_t *restrict attr,
21              void **restrict stackaddr);
22       int pthread_attr_setstackaddr(pthread_attr_t *attr, void *stackaddr);
23
24

DESCRIPTION

26       The  pthread_attr_getstackaddr()  and pthread_attr_setstackaddr() func‐
27       tions, respectively, shall get and set the  thread  creation  stackaddr
28       attribute in the attr object.
29
30       The  stackaddr  attribute  specifies the location of storage to be used
31       for the created thread's stack. The size of the  storage  shall  be  at
32       least {PTHREAD_STACK_MIN}.
33

RETURN VALUE

35       Upon    successful    completion,    pthread_attr_getstackaddr()    and
36       pthread_attr_setstackaddr() shall return a value of  0;  otherwise,  an
37       error number shall be returned to indicate the error.
38
39       The pthread_attr_getstackaddr() function stores the stackaddr attribute
40       value in stackaddr if successful.
41

ERRORS

43       No errors are defined.
44
45       These functions shall not return an error code of [EINTR].
46
47       The following sections are informative.
48

EXAMPLES

50       None.
51

APPLICATION USAGE

53       The specification of the stackaddr attribute presents several  ambigui‐
54       ties  that  make  portable  use  of  these  interfaces  impossible. The
55       description of the single address parameter as a "stack" does not spec‐
56       ify  a  particular  relationship  between  the  address and the "stack"
57       implied by that address. For example, the address may be taken  as  the
58       low  memory  address of a buffer intended for use as a stack, or it may
59       be taken as the address to be used as the initial stack pointer  regis‐
60       ter  value  for the new thread. These two are not the same except for a
61       machine on which the stack grows "up" from low memory to high,  and  on
62       which  a  "push"  operation  first  stores the value in memory and then
63       increments the stack pointer register. Further, on a machine where  the
64       stack  grows  "down"  from  high  memory  to low, interpretation of the
65       address as the "low memory" address requires  a  determination  of  the
66       intended size of the stack. IEEE Std 1003.1-2001 has introduced the new
67       interfaces  pthread_attr_setstack()  and   pthread_attr_getstack()   to
68       resolve these ambiguities.
69

RATIONALE

71       None.
72

FUTURE DIRECTIONS

74       None.
75

SEE ALSO

77       pthread_attr_destroy(),                  pthread_attr_getdetachstate(),
78       pthread_attr_getstack(), pthread_attr_getstacksize(), pthread_attr_set‐
79       stack(),    pthread_create(),    the   Base   Definitions   volume   of
80       IEEE Std 1003.1-2001, <limits.h>, <pthread.h>
81
83       Portions of this text are reprinted and reproduced in  electronic  form
84       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
85       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
86       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
87       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
88       event of any discrepancy between this version and the original IEEE and
89       The Open Group Standard, the original IEEE and The Open Group  Standard
90       is  the  referee document. The original Standard can be obtained online
91       at http://www.opengroup.org/unix/online.html .
92
93
94
95IEEE/The Open Group                  2003        PTHREAD_ATTR_GETSTACKADDR(3P)
Impressum