summaryrefslogtreecommitdiff
path: root/usr/src/man/man3c_db/td_ta_new.3c_db
blob: 36c6395f5bf7f5017e61acc0bb353fe5b19cd1fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
'\" te
.\"  Copyright (c) 1998 Sun Microsystems, Inc.  All Rights Reserved
.\" 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.
.\" 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.
.\" 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]
.TH TD_TA_NEW 3C_DB "Oct 20, 1998"
.SH NAME
td_ta_new, td_ta_delete, td_ta_get_ph \- allocate and deallocate process
handles for libc_db
.SH SYNOPSIS
.LP
.nf
cc [ \fIflag\fR... ] \fIfile\fR... -lc_db [ \fIlibrary\fR... ]
#include <proc_service.h>
#include <thread_db.h>

\fBtd_err_e\fR \fBtd_ta_new\fR(\fBconst struct ps_prochandle *\fR\fIph_p\fR, \fBtd_thragent_t **\fR\fIta_pp\fR);
.fi

.LP
.nf
\fBtd_err_e\fR \fBtd_ta_delete\fR(\fBconst td_thragent_t *\fR\fIta_p\fR);
.fi

.LP
.nf
\fBtd_err_e\fR \fBtd_ta_get_ph\fR(\fBconst td_thragent_t *\fR\fIta_p\fR, \fBstruct ps_prochandle **\fR\fIph_pp\fR);
.fi

.SH DESCRIPTION
.sp
.LP
The \fBtd_ta_new()\fR function registers a target process with
\fBlibc_db\fR(3LIB) and allocates an internal process handle of type
\fBtd_thragent_t\fR for this target process.  Subsequent calls to \fBlibc_db\fR
can use this handle to refer to this target process.
.sp
.LP
There are actually two process handles,  an internal process handle assigned by
\fBlibc_db\fR and an external process handle assigned by the \fBlibc_db\fR
client. There is a one-to-one correspondence between the two handles.  When the
client calls a \fBlibc_db\fR function, it uses the internal process handle.
When \fBlibc_db\fR calls one of the client-provided routines listed in
\fBproc_service\fR(3PROC), it uses the external process handle.
.sp
.LP
The \fIph\fR argument is the external process handle that \fBlibc_db\fR should
use to identify this target process to the controlling process when it calls
routines in the imported interface.
.sp
.LP
If this call is successful, the value of the newly allocated
\fBtd_thragent_t\fR handle is returned in  *\fIta_pp\fR. The
\fBtd_ta_delete()\fR function deregisters a target process with \fBlibc_db\fR,
which deallocates its internal process handle and frees any other resources
\fBlibc_db\fR has acquired with respect to the target process. The \fIta_p\fR
argument specifies the target process to be deregistered.
.sp
.LP
The \fBtd_ta_get_ph()\fR function returns in *\fIph_pp\fR the external process
handle that corresponds to the internal process handle \fIta_p\fR. This is
useful for checking internal consistency.
.SH RETURN VALUES
.sp
.ne 2
.na
\fB\fBTD_OK\fR\fR
.ad
.RS 18n
The call completed successfully.
.RE

.sp
.ne 2
.na
\fB\fBTD_BADPH\fR\fR
.ad
.RS 18n
A \fINULL\fR external process handle was passed to \fBtd_ta_new()\fR.
.RE

.sp
.ne 2
.na
\fB\fBTD_ERR\fR\fR
.ad
.RS 18n
The \fIta_pp\fR argument is \fINULL\fR or an internal error occurred.
.RE

.sp
.ne 2
.na
\fB\fBTD_DBERR\fR\fR
.ad
.RS 18n
A call to one of the imported interface routines failed.
.RE

.sp
.ne 2
.na
\fB\fBTD_MALLOC\fR\fR
.ad
.RS 18n
Memory allocation failure.
.RE

.sp
.ne 2
.na
\fB\fBTD_NOLIBTHREAD\fR\fR
.ad
.RS 18n
The target process does not appear to be multithreaded.
.RE

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(7) for description of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
MT-Level	Safe
.TE

.SH SEE ALSO
.sp
.LP
.BR libc_db (3LIB),
.BR proc_service (3PROC),
.BR attributes (7)