Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Threads Library Functionstd_ta_new(3THR)


NAME

 td_ta_new, td_ta_delete, td_ta_get_ph - allocate and deallocate process handles for libthread_db

SYNOPSIS

 
cc [ flag ... ] file ... -lthread_db [ library ... ]
#include <proc_service.h>
#include <thread_db.h>
td_err_e td_ta_new(const struct ps_prochandle *ph_p, td_thragent_t **ta_pp);
 td_err_e td_ta_delete(const td_thragent_t *ta_p);
 td_err_e td_ta_get_ph(const td_thragent_t *ta_p, struct ps_prochandle **ph_pp);

DESCRIPTION

 

td_ta_new() registers a target process with libthread_db and allocates an internal process handle of type td_thragent_t for this target process. Subsequent calls to libthread_db can use this handle to refer to this target process.

There are actually two process handles, an internal process handle assigned by libthread_db and an external process handle assigned by the libthread_db client. There is a one-to-one correspondence between the two handles. When the client calls a libthread_db routine, it uses the internal process handle. When libthread_db calls one of the client-provided routines listed in proc_service(3PROC), it uses the external process handle.

ph is the external process handle that libthread_db should use to identify this target process to the controlling process when it calls routines in the imported interface.

If this call is successful, the value of the newly allocated td_thragent_t handle is returned in *ta_pp. td_ta_delete() deregisters a target process with libthread_db, which deallocates its internal process handle and frees any other resources libthread_db has acquired with respect to the target process. ta_p specifies the target process to be deregistered.

td_ta_get_ph() returns in *ph_pp the external process handle that corresponds to the internal process handle ta_p. This is useful for checking internal consistency.

RETURN VALUES

 
TD_OK
The call completed successfully.
TD_BADPH
A NULL external process handle was passed in to td_ta_new.
TD_ERR
ta_pp is NULL, or an internal error occurred.
TD_DBERR
A call to one of the imported interface routines failed.
TD_MALLOC
Memory allocation failure.
TD_NOLIBTHREAD
The target process does not appear to be multithreaded.

ATTRIBUTES

 

See attributes(5) for description of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
MT-LevelSafe

SEE ALSO

 

libthread_db(3THR), proc_service(3PROC), libthread_db(3LIB), attributes(5)


SunOS 5.9Go To TopLast Changed 20 Oct 1998

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.