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

Technical Reference: Base Operating System and Extensions, Volume 1


pthdb_pthread_arg Subroutine

Purpose

Reports the information associated with a pthread.

Library

pthread debug library (libpthdebug.a)

Syntax


#include <sys/pthdebug.h>


int pthdb_pthread_arg (pthdb_session_t session,
pthdb_pthread_t pthread,
pthdb_addr_t * argp)


int pthdb_pthread_addr (pthdb_session_t session,
pthdb_pthread_t pthread,
pthdb_addr_t *addrp)


int pthdb_pthread_cancelpend (pthdb_session_t session,
pthdb_pthread_t pthread,
int * cancelpendp)


int pthdb_pthread_cancelstate (pthdb_session_t session,
pthdb_pthread_t pthread,
pthdb_cancelstate_t * cancelstatep)


int pthdb_pthread_canceltype (pthdb_session_t session,
pthdb_pthread_t pthread,
pthdb_canceltype_t * canceltypep)


int pthdb_pthread_detachstate (pthdb_session_t session,
pthdb_pthread_t pthread,
pthdb_detachstate_t * detachstatep)


int pthdb_pthread_exit (pthdb_session_t session,
pthdb_pthread_t pthread,
pthdb_addr_t * exitp)


int pthdb_pthread_func (pthdb_session_t session,
pthdb_pthread_t pthread,
pthdb_addr_t * funcp)


int pthdb_pthread_ptid (pthdb_session_t session,
pthdb_pthread_t pthread,
pthread_t * ptidp)


int pthdb_pthread_schedparam (pthdb_session_t session,
pthdb_pthread_t pthread,
struct sched_param * schedparamp);


int pthdb_pthread_schedpolicy (pthdb_session_t session,
pthdb_pthread_t pthread,
pthdb_schedpolicy_t * schedpolicyp)


int pthdb_pthread_schedpriority (pthdb_session_t session,
pthdb_pthread_t pthread,
int * schedpriorityp)


int pthdb_pthread_scope (pthdb_session_t session,
pthdb_pthread_t pthread,
pthdb_scope_t * scopep)


int pthdb_pthread_state (pthdb_session_t session,
pthdb_pthread_t pthread,
pthdb_state_t * statep)


int pthdb_pthread_suspendstate (pthdb_session_t session,
pthdb_pthread_t pthread,
pthdb_suspendstate_t * suspendstatep)


int pthdb_ptid_pthread (pthdb_session_t session,
pthread_t ptid,
pthdb_pthread_t * pthreadp)

Description

pthdb_pthread_arg reports the initial argument passed to the pthread's start function.

pthdb_pthread_addr reports the address of the pthread_t.

pthdb_pthread_cancelpend reports non-zero if cancellation is pending on the pthread; if not, it reports zero.

pthdb_pthread_cancelstate reports whether cancellation is enabled (PCS_ENABLE) or disabled (PCS_DISABLE). PCS_NOTSUP is reserved for unexpected results.

pthdb_pthread_canceltype reports whether cancellation is deferred (PCT_DEFERRED) or asynchronous (PCT_ASYNCHRONOUS). PCT_NOTSUP is reserved for unexpected results.

pthdb_pthread_detachstate reports whether the pthread is detached (PDS_DETACHED) or joinable (PDS_JOINABLE). PDS_NOTSUP is reserved for unexpected results.

pthdb_pthread_exit reports the exit status returned by the pthread via pthread_exit. This is only valid if the pthread has exited (PST_TERM).

pthdb_pthread_func reports the address of the pthread's start function.

pthdb_pthread_ptid reports the pthread identifier (pthread_t) associated with the pthread.

pthdb_pthread_schedparam reports the pthread's scheduling parameters. This currently includes policy and priority.

pthdb_pthread_schedpolicy reports whether the pthread's scheduling policy is other (SP_OTHER), first in first out (SP_FIFO), or round robin (SP_RR). SP_NOTSUP is reserved for unexpected results.

pthdb_pthread_schedpriority reports the pthread's scheduling priority.

pthdb_pthread_scope reports whether the pthread has process scope (PS_PROCESS) or system scope (PS_SYSTEM). PS_NOTSUP is reserved for unexpected results.

pthdb_pthread_state reports whether the pthread is being created (PST_IDLE), currently running (PST_RUN), waiting on an event (PST_SLEEP), waiting on a cpu (PST_READY), or waiting on a join or detach (PST_TERM). PST_NOTSUP is reserved for unexpected results.

pthdb_pthread_suspendstate reports whether the pthread is suspended (PSS_SUSPENDED) or not (PSS_UNSUSPENDED). PSS_NOTSUP is reserved for unexpected results.

pthdb_ptid_pthread reports the pthread for the ptid.

Parameters


addr pthread address
argp Initial argument buffer.
cancelpendp Cancel pending buffer.
cancelstatep Cancel state buffer.
canceltypep Cancel type buffer.
detachstatep Detach state buffer.
exitp Exit value buffer.
funcp Start function buffer.
pthread pthread handle.
pthreadp Pointer to pthread handle.
ptid pthread identifier
ptidp pthread identifier buffer.
schedparamp Scheduling parameters buffer.
schedpolicyp Scheduling policy buffer.
schedpriorityp Scheduling priority buffer.
scopep Contention scope buffer.
session Session handle.
statep State buffer.
suspendstatep Suspend state buffer.

Return Values

If successful, these functions return PTHDB_SUCCESS, else an error code is returned.

Error Codes

PTHDB_BAD_SESSION Invalid session handle.
PTHDB_BAD_PTHREAD Invalid pthread handle.
PTHDB_BAD_POINTER Invalid buffer pointer.
PTHDB_BAD_PTID Invalid ptid.
PTHDB_CALLBACK Debugger call back error.
PTHDB_NOTSUP Not supported.
PTHDB_INTERNAL Error in library.

Implementation Specifics

These subroutines are part of Base Operating System (BOS) Runtime.

Related Information

The pthdebug.h file.

The pthread.h file.


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