pthdb_attr_detachstate,pthdb_attr_addr, pthdb_attr_guardsize,pthdb_attr_inheritsched, pthdb_attr_schedparam,pthdb_attr_schedpolicy, pthdb_attr_schedpriority,pthdb_attr_scope, pthdb_attr_stackaddr,pthdb_attr_stacksize, or pthdb_attr_suspendstate Subroutine

Purpose

Query the various fields of a pthread attribute and return the results in the specified buffer.

Library

pthread debug library (libpthdebug.a)

Syntax

#include <sys/pthdebug.h>

int pthdb_attr_detachstate (pthdb_session_t      session,
                            pthdb_attr_t         attr,
                            pthdb_detachstate_t * detachstatep);
int pthdb_attr_addr (pthdb_session_t      session,
                     pthdb_attr_t         attr,
                     pthdb_addr_t * addrp);
int pthdb_attr_guardsize (pthdb_session_t      session,
                          pthdb_attr_t         attr,
                          pthdb_size_t * guardsizep);
int pthdb_attr_inheritsched (pthdb_session_t       session,
                             pthdb_attr_t          attr,
                             pthdb_inheritsched_t * inheritschedp);
int pthdb_attr_schedparam (pthdb_session_t     session,
                           pthdb_attr_t        attr,
                           struct sched_param * schedparamp);
int pthdb_attr_schedpolicy (pthdb_session_t  session,
                            pthdb_attr_t     attr,
                            pthdb_policy_t  * schedpolicyp)
int pthdb_attr_schedpriority (pthdb_session_t  session,
                              pthdb_attr_t     attr,
                              int             * schedpriorityp)
int pthdb_attr_scope (pthdb_session_t  session,
                      pthdb_attr_t     attr,
                      pthdb_scope_t   * scopep)
int pthdb_attr_stackaddr (pthdb_session_t      session,
                          pthdb_attr_t         attr,
                          pthdb_size_t * stackaddrp);
int pthdb_attr_stacksize (pthdb_session_t      session,
                          pthdb_attr_t         attr,
                          pthdb_size_t * stacksizep);
int pthdb_attr_suspendstate (pthdb_session_t       session,
                             pthdb_attr_t          attr,
                             pthdb_suspendstate_t * suspendstatep)

Description

Each pthread is created using either the default pthread attribute or a user-specified pthread attribute. These functions query the various fields of a pthread attribute and, if successful, return the result in the buffer specified. In all cases, the values returned reflect the expected fields of a pthread created with the attribute specified.

pthdb_attr_detachstate reports if the created pthread is detachable (PDS_DETACHED) or joinable (PDS_JOINABLE). PDS_NOTSUP is reserved for unexpected results.

pthdb_attr_addr reports the address of the pthread_attr_t.

pthdb_attr_guardsize reports the guard size for the attribute.

pthdb_attr_inheritsched reports whether the created pthread will run with scheduling policy and scheduling parameters from the created pthread (PIS_INHERIT), or from the attribute (PIS_EXPLICIT). PIS_NOTSUP is reserved for unexpected results.

pthdb_attr_schedparam reports the scheduling parameters associated with the pthread attribute. See pthdb_attr_inheritsched for additional information.

pthdb_attr_schedpolicy reports whether the scheduling policy associated with the pthread attribute is other (SP_OTHER), first in first out (SP_FIFO), or round robin (SP_RR). SP_NOTSUP is reserved for unexpected results.

pthdb_attr_schedpriority reports the scheduling priority associated with the pthread attribute. See pthdb_attr_inheritsched for additional information.

pthdb_attr_scope reports whether the created pthread will have process scope (PS_PROCESS) or system scope (PS_SYSTEM). PS_NOTSUP is reserved for unexpected results.

pthdb_attr_stackaddr reports the address of the stack.

pthdb_attr_stacksize reports the size of the stack.

pthdb_attr_suspendstate reports whether the created pthread will be suspended (PSS_SUSPENDED) or not (PSS_UNSUSPENDED). PSS_NOTSUP is reserved for unexpected results.

Parameters

Item Description
addr Attributes address.
attr Attributes handle.
detachstatep Detach state buffer.
guardsizep Attribute guard size.
inheritschedp Inherit scheduling buffer.
schedparamp Scheduling parameters buffer.
schedpolicyp Scheduling policy buffer.
schedpriorityp Scheduling priority buffer.
scopep Contention scope buffer.
session Session handle.
stackaddrp Attributes stack address.
stacksizep Attributes stack size.
suspendstatep Suspend state buffer.

Return Values

If successful these functions return PTHDB_SUCCESS. Otherwise, and error code is returned.

Error Codes

Item Description
PTHDB_BAD_SESSION Invalid session handle.
PTHDB_BAD_ATTR Invalid attribute handle.
PTHDB_BAD_POINTER Invalid buffer pointer.
PTHDB_CALLBACK Debugger call back error.
PTHDB_NOTSUP Not supported.
PTHDB_INTERNAL Internal library error.