mirror of https://github.com/mkerrisk/man-pages
94 lines
3.5 KiB
Plaintext
94 lines
3.5 KiB
Plaintext
|
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved
|
||
|
.TH "PTHREAD_ATTR_GETSTACKADDR" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
|
||
|
.\" pthread_attr_getstackaddr
|
||
|
.SH NAME
|
||
|
pthread_attr_getstackaddr, pthread_attr_setstackaddr \- get and set
|
||
|
the stackaddr attribute
|
||
|
.SH SYNOPSIS
|
||
|
.LP
|
||
|
\fB#include <pthread.h>
|
||
|
.br
|
||
|
.sp
|
||
|
\fP
|
||
|
.LP
|
||
|
\fBint pthread_attr_getstackaddr(const pthread_attr_t *restrict\fP
|
||
|
\fIattr\fP\fB,
|
||
|
.br
|
||
|
\ \ \ \ \ \ void **restrict\fP \fIstackaddr\fP\fB);
|
||
|
.br
|
||
|
int pthread_attr_setstackaddr(pthread_attr_t *\fP\fIattr\fP\fB, void
|
||
|
*\fP\fIstackaddr\fP\fB); \fP
|
||
|
\fB
|
||
|
.br
|
||
|
\fP
|
||
|
.SH DESCRIPTION
|
||
|
.LP
|
||
|
The \fIpthread_attr_getstackaddr\fP() and \fIpthread_attr_setstackaddr\fP()
|
||
|
functions, respectively, shall get and set the
|
||
|
thread creation \fIstackaddr\fP attribute in the \fIattr\fP object.
|
||
|
.LP
|
||
|
The \fIstackaddr\fP attribute specifies the location of storage to
|
||
|
be used for the created thread's stack. The size of the
|
||
|
storage shall be at least {PTHREAD_STACK_MIN}.
|
||
|
.SH RETURN VALUE
|
||
|
.LP
|
||
|
Upon successful completion, \fIpthread_attr_getstackaddr\fP() and
|
||
|
\fIpthread_attr_setstackaddr\fP() shall return a value of 0;
|
||
|
otherwise, an error number shall be returned to indicate the error.
|
||
|
.LP
|
||
|
The \fIpthread_attr_getstackaddr\fP() function stores the \fIstackaddr\fP
|
||
|
attribute value in \fIstackaddr\fP if
|
||
|
successful.
|
||
|
.SH ERRORS
|
||
|
.LP
|
||
|
No errors are defined.
|
||
|
.LP
|
||
|
These functions shall not return an error code of [EINTR].
|
||
|
.LP
|
||
|
\fIThe following sections are informative.\fP
|
||
|
.SH EXAMPLES
|
||
|
.LP
|
||
|
None.
|
||
|
.SH APPLICATION USAGE
|
||
|
.LP
|
||
|
The specification of the \fIstackaddr\fP attribute presents several
|
||
|
ambiguities that make portable use of these interfaces
|
||
|
impossible. The description of the single address parameter as a "stack"
|
||
|
does not specify a particular relationship between the
|
||
|
address and the "stack" implied by that address. For example, the
|
||
|
address may be taken as the low memory address of a buffer
|
||
|
intended for use as a stack, or it may be taken as the address to
|
||
|
be used as the initial stack pointer register value for the new
|
||
|
thread. These two are not the same except for a machine on which the
|
||
|
stack grows "up" from low memory to high, and on which a
|
||
|
"push" operation first stores the value in memory and then increments
|
||
|
the stack pointer register. Further, on a machine where the
|
||
|
stack grows "down" from high memory to low, interpretation of the
|
||
|
address as the "low memory" address requires a determination
|
||
|
of the intended size of the stack. IEEE\ Std\ 1003.1-2001 has introduced
|
||
|
the new interfaces \fIpthread_attr_setstack\fP() and \fIpthread_attr_getstack\fP()
|
||
|
to resolve these ambiguities.
|
||
|
.SH RATIONALE
|
||
|
.LP
|
||
|
None.
|
||
|
.SH FUTURE DIRECTIONS
|
||
|
.LP
|
||
|
None.
|
||
|
.SH SEE ALSO
|
||
|
.LP
|
||
|
\fIpthread_attr_destroy\fP() , \fIpthread_attr_getdetachstate\fP()
|
||
|
, \fIpthread_attr_getstack\fP() , \fIpthread_attr_getstacksize\fP()
|
||
|
, \fIpthread_attr_setstack\fP() , \fIpthread_create\fP() , the
|
||
|
Base Definitions volume of IEEE\ Std\ 1003.1-2001, \fI<limits.h>\fP,
|
||
|
\fI<pthread.h>\fP
|
||
|
.SH COPYRIGHT
|
||
|
Portions of this text are reprinted and reproduced in electronic form
|
||
|
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
|
||
|
-- Portable Operating System Interface (POSIX), The Open Group Base
|
||
|
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
|
||
|
Electrical and Electronics Engineers, Inc and The Open Group. In the
|
||
|
event of any discrepancy between this version and the original IEEE and
|
||
|
The Open Group Standard, the original IEEE and The Open Group Standard
|
||
|
is the referee document. The original Standard can be obtained online at
|
||
|
http://www.opengroup.org/unix/online.html .
|