pthread_attr_getstackaddr Subroutine
Purpose
Returns the value of the stackaddr attribute of a thread attributes object.
Library
Threads Library (libpthreads.a)
Syntax
#include <pthread.h>
int pthread_attr_getstackaddr (attr, stackaddr)
const pthread_attr_t *attr;
void **stackaddr;
Description
The pthread_attr_getstackaddr subroutine returns the value of the stackaddr attribute of the thread attributes object attr. This attribute specifies the stack address of the thread created with this attributes object.
Note: The pthread.h header
file must be the first included file of each source file using the
threads library. Otherwise, the -D_THREAD_SAFE compilation
flag should be used, or the cc_r compiler used. In this case, the
flag is automatically set.
Parameters
Item | Description |
---|---|
attr | Specifies the thread attributes object. |
stackaddr | Points to where the stackaddr attribute value will be stored. |
Return Values
Upon successful completion, the value of the stackaddr attribute is returned via the stackaddr parameter, and 0 is returned. Otherwise, an error code is returned.
Error Codes
The pthread_attr_getstackaddr subroutine is unsuccessful if the following is true:
Item | Description |
---|---|
EINVAL | The attr parameter is not valid. |
This function will not return EINTR.