[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

pthread_attr_getstacksize Subroutine

Purpose

Returns the value of the stacksize attribute of a thread attributes object.

Library

Threads Library (libpthreads.a)

Syntax

#include <pthread.h>

int pthread_attr_getstacksize (attr, stacksize)
const pthread_attr_t *attr;
size_t *stacksize;

Description

The pthread_attr_getstacksize subroutine returns the value of the stacksize attribute of the thread attributes object attr. This attribute specifies the minimum stacksize of a thread created with this attributes object. The value is given in bytes. For 32-bit compiled applications, the default stacksize is 96 KB (defined in the pthread.h file). For 64-bit compiled applications, the default stacksize is 192 KB (defined in the pthread.h file).

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

attr Specifies the thread attributes object.
stacksize Points to where the stacksize attribute value will be stored.

Return Values

Upon successful completion, the value of the stacksize attribute is returned via the stacksize parameter, and 0 is returned. Otherwise, an error code is returned.

Error Codes

The pthread_attr_getstacksize subroutine is unsuccessful if the following is true:

EINVAL The attr or stacksize parameters are not valid.

This function will not return an error code of [EINTR].

Related Information

The pthread_attr_setstacksize (pthread_attr_setstacksize Subroutine) subroutine, pthread_attr_init (pthread_attr_init Subroutine) subroutine, the pthread.h file.

Advanced Attributes in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

Threads Library Options and Threads Library Quick Reference in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]