Name

NAME

pthread_attr_getstackaddr, pthread_attr_setstackaddr — get and set the stackaddr attribute

SYNOPSIS

THR TSA #include <pthread.h>

OB      int pthread_attr_getstackaddr(const pthread_attr_t *restrict attr,
            void **restrict stackaddr);
        int pthread_attr_setstackaddr(pthread_attr_t *attr, void *stackaddr);

DESCRIPTION

The pthread_attr_getstackaddr() and pthread_attr_setstackaddr() functions, respectively, shall get and set the thread creation stackaddr attribute in the attr object.

The stackaddr 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}.

RETURN VALUE

Upon successful completion, pthread_attr_getstackaddr() and pthread_attr_setstackaddr() shall return a value of 0; otherwise, an error number shall be returned to indicate the error.

The pthread_attr_getstackaddr() function stores the stackaddr attribute value in stackaddr if successful.

ERRORS

No errors are defined.

These functions shall not return an error code of [EINTR].

EXAMPLES

None.

APPLICATION USAGE

The specification of the stackaddr 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 ...

Get Professional Multicore Programming: Design and Implementation for C++ Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.