Linux Standard Base Core Specification 4.1 | ||
---|---|---|
<<< Previous | Next >>> |
pthread_getattr_np() fills in the thread attribute object attr with attribute values describing the running thread thread. This is useful to detect runtime changes from the values specified in the thread attributes object used to create the thread with pthread_create(). The following differences may be noted:
The detach state, since a joinable thread may have detached itself after creation. Use pthread_attr_getdetachstate() to extract from attr.
The stack size, which the implementation may align to a suitable boundary. Use pthread_attr_getstack() to extract from attr.
The guard size, which the implementation may round upwards to a multiple of the page size, or ignore (i.e., treat as 0), if the application is allocating its own stack. Use pthread_attr_getguardsize() to extract from attr.
If the stack address attribute was not set in the thread attributes object used to create the thread, then the thread attributes object returned by pthread_getattr_np() will show the actual stack address the implementation selected for the thread. Use pthread_attr_getstack() to extract from attr.
The thread attributes object attr should be destroyed using pthread_attr_destroy() when it is no longer needed.
On success, pthread_getattr_np() returns 0; on error, it returns a non-zero error number.
ENOMEM | Insufficient memory to complete the operation. |
In addition, if thread refers to the
main thread, then
pthread_getattr_np()
may also fail due to errors from various underlying calls:
fopen(), if
the pseudo-file containing the memory region map cannot be opened;
getrlimit() if the RLIMIT_STACK
resource limit it not supported.
pthread_attr_destroy(), pthread_attr_getdetachstate(), pthread_attr_getguardsize(), pthread_attr_getstack(), pthread_create().
<<< Previous | Home | Next >>> |
_pthread_cleanup_push | Up | pthread_mutex_consistent_np |