]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3p/pthread_attr_getstackaddr.3p
Import of man-pages 1.70
[thirdparty/man-pages.git] / man3p / pthread_attr_getstackaddr.3p
1 .\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved
2 .TH "PTHREAD_ATTR_GETSTACKADDR" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
3 .\" pthread_attr_getstackaddr
4 .SH NAME
5 pthread_attr_getstackaddr, pthread_attr_setstackaddr \- get and set
6 the stackaddr attribute
7 .SH SYNOPSIS
8 .LP
9 \fB#include <pthread.h>
10 .br
11 .sp
12 \fP
13 .LP
14 \fBint pthread_attr_getstackaddr(const pthread_attr_t *restrict\fP
15 \fIattr\fP\fB,
16 .br
17 \ \ \ \ \ \ void **restrict\fP \fIstackaddr\fP\fB);
18 .br
19 int pthread_attr_setstackaddr(pthread_attr_t *\fP\fIattr\fP\fB, void
20 *\fP\fIstackaddr\fP\fB); \fP
21 \fB
22 .br
23 \fP
24 .SH DESCRIPTION
25 .LP
26 The \fIpthread_attr_getstackaddr\fP() and \fIpthread_attr_setstackaddr\fP()
27 functions, respectively, shall get and set the
28 thread creation \fIstackaddr\fP attribute in the \fIattr\fP object.
29 .LP
30 The \fIstackaddr\fP attribute specifies the location of storage to
31 be used for the created thread's stack. The size of the
32 storage shall be at least {PTHREAD_STACK_MIN}.
33 .SH RETURN VALUE
34 .LP
35 Upon successful completion, \fIpthread_attr_getstackaddr\fP() and
36 \fIpthread_attr_setstackaddr\fP() shall return a value of 0;
37 otherwise, an error number shall be returned to indicate the error.
38 .LP
39 The \fIpthread_attr_getstackaddr\fP() function stores the \fIstackaddr\fP
40 attribute value in \fIstackaddr\fP if
41 successful.
42 .SH ERRORS
43 .LP
44 No errors are defined.
45 .LP
46 These functions shall not return an error code of [EINTR].
47 .LP
48 \fIThe following sections are informative.\fP
49 .SH EXAMPLES
50 .LP
51 None.
52 .SH APPLICATION USAGE
53 .LP
54 The specification of the \fIstackaddr\fP attribute presents several
55 ambiguities that make portable use of these interfaces
56 impossible. The description of the single address parameter as a "stack"
57 does not specify a particular relationship between the
58 address and the "stack" implied by that address. For example, the
59 address may be taken as the low memory address of a buffer
60 intended for use as a stack, or it may be taken as the address to
61 be used as the initial stack pointer register value for the new
62 thread. These two are not the same except for a machine on which the
63 stack grows "up" from low memory to high, and on which a
64 "push" operation first stores the value in memory and then increments
65 the stack pointer register. Further, on a machine where the
66 stack grows "down" from high memory to low, interpretation of the
67 address as the "low memory" address requires a determination
68 of the intended size of the stack. IEEE\ Std\ 1003.1-2001 has introduced
69 the new interfaces \fIpthread_attr_setstack\fP() and \fIpthread_attr_getstack\fP()
70 to resolve these ambiguities.
71 .SH RATIONALE
72 .LP
73 None.
74 .SH FUTURE DIRECTIONS
75 .LP
76 None.
77 .SH SEE ALSO
78 .LP
79 \fIpthread_attr_destroy\fP() , \fIpthread_attr_getdetachstate\fP()
80 , \fIpthread_attr_getstack\fP() , \fIpthread_attr_getstacksize\fP()
81 , \fIpthread_attr_setstack\fP() , \fIpthread_create\fP() , the
82 Base Definitions volume of IEEE\ Std\ 1003.1-2001, \fI<limits.h>\fP,
83 \fI<pthread.h>\fP
84 .SH COPYRIGHT
85 Portions of this text are reprinted and reproduced in electronic form
86 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
87 -- Portable Operating System Interface (POSIX), The Open Group Base
88 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
89 Electrical and Electronics Engineers, Inc and The Open Group. In the
90 event of any discrepancy between this version and the original IEEE and
91 The Open Group Standard, the original IEEE and The Open Group Standard
92 is the referee document. The original Standard can be obtained online at
93 http://www.opengroup.org/unix/online.html .