2 .\" Copyright (c) 1998 Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH TD_TA_NEW 3C_DB "Oct 20, 1998"
8 td_ta_new, td_ta_delete, td_ta_get_ph \- allocate and deallocate process
13 cc [ \fIflag\fR... ] \fIfile\fR... -lc_db [ \fIlibrary\fR... ]
14 #include <proc_service.h>
15 #include <thread_db.h>
17 \fBtd_err_e\fR \fBtd_ta_new\fR(\fBconst struct ps_prochandle *\fR\fIph_p\fR, \fBtd_thragent_t **\fR\fIta_pp\fR);
22 \fBtd_err_e\fR \fBtd_ta_delete\fR(\fBconst td_thragent_t *\fR\fIta_p\fR);
27 \fBtd_err_e\fR \fBtd_ta_get_ph\fR(\fBconst td_thragent_t *\fR\fIta_p\fR, \fBstruct ps_prochandle **\fR\fIph_pp\fR);
33 The \fBtd_ta_new()\fR function registers a target process with
34 \fBlibc_db\fR(3LIB) and allocates an internal process handle of type
35 \fBtd_thragent_t\fR for this target process. Subsequent calls to \fBlibc_db\fR
36 can use this handle to refer to this target process.
39 There are actually two process handles, an internal process handle assigned by
40 \fBlibc_db\fR and an external process handle assigned by the \fBlibc_db\fR
41 client. There is a one-to-one correspondence between the two handles. When the
42 client calls a \fBlibc_db\fR function, it uses the internal process handle.
43 When \fBlibc_db\fR calls one of the client-provided routines listed in
44 \fBproc_service\fR(3PROC), it uses the external process handle.
47 The \fIph\fR argument is the external process handle that \fBlibc_db\fR should
48 use to identify this target process to the controlling process when it calls
49 routines in the imported interface.
52 If this call is successful, the value of the newly allocated
53 \fBtd_thragent_t\fR handle is returned in *\fIta_pp\fR. The
54 \fBtd_ta_delete()\fR function deregisters a target process with \fBlibc_db\fR,
55 which deallocates its internal process handle and frees any other resources
56 \fBlibc_db\fR has acquired with respect to the target process. The \fIta_p\fR
57 argument specifies the target process to be deregistered.
60 The \fBtd_ta_get_ph()\fR function returns in *\fIph_pp\fR the external process
61 handle that corresponds to the internal process handle \fIta_p\fR. This is
62 useful for checking internal consistency.
70 The call completed successfully.
79 A \fINULL\fR external process handle was passed to \fBtd_ta_new()\fR.
88 The \fIta_pp\fR argument is \fINULL\fR or an internal error occurred.
97 A call to one of the imported interface routines failed.
103 \fB\fBTD_MALLOC\fR\fR
106 Memory allocation failure.
112 \fB\fBTD_NOLIBTHREAD\fR\fR
115 The target process does not appear to be multithreaded.
121 See \fBattributes\fR(5) for description of the following attributes:
129 ATTRIBUTE TYPE ATTRIBUTE VALUE
137 \fBlibc_db\fR(3LIB), \fBproc_service\fR(3PROC), \fBattributes\fR(5)