1<!--$Id: env_set_thread_id_string.so,v 10.2 2007/09/26 15:11:30 bostic Exp $-->
2<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
3<!--See the file LICENSE for redistribution information.-->
4<html>
5<head>
6<title>Berkeley DB: DB_ENV-&gt;set_thread_id_string</title>
7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
9</head>
10<body bgcolor=white>
11<table width="100%"><tr valign=top>
12<td>
13<b>DB_ENV-&gt;set_thread_id_string</b>
14</td>
15<td align=right>
16<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a>
17<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td>
18</tr></table>
19<hr size=1 noshade>
20<tt>
21<b><pre>
22#include &lt;db.h&gt;
23<p>
24int
25DB_ENV-&gt;set_thread_id_string(DB_ENV *dbenv,
26    char *(*thread_id_string)(DB_ENV *dbenv,
27    pid_t pid, db_threadid_t tid, char *buf));
28</pre></b>
29<hr size=1 noshade>
30<b>Description: DB_ENV-&gt;set_thread_id_string</b>
31<p>Declare a function that formats a process ID and thread ID identifier
32pair for display into a caller-supplied buffer.  The function must
33return a reference to the caller-specified buffer.  The
34DB_ENV-&gt;set_thread_id_string method supports the
35<a href="../api_c/env_set_thread_id.html">DB_ENV-&gt;set_thread_id</a> method.</p>
36<p>The DB_ENV-&gt;set_thread_id_string method configures operations performed using the specified
37<a href="../api_c/env_class.html">DB_ENV</a> handle, not all operations performed on the underlying
38database environment.</p>
39<p>The DB_ENV-&gt;set_thread_id_string method may be called at any time during the life of the
40application.</p>
41<p>The DB_ENV-&gt;set_thread_id_string method
42returns a non-zero error value on failure
43and 0 on success.
44</p>
45<b>Parameters</b> <br>
46 <b>thread_id_string</b><ul compact><li>The <b>thread_id_string</b> parameter is a function which returns a
47buffer in which is an identifier pair formatted for display.  The
48function takes four arguments:</ul>
49<br>
50<b><b>dbenv</b></b><ul compact><li>The <b>dbenv</b> parameter is the enclosing database environment
51handle, allowing application access to the application-private fields
52of that object.</ul>
53<b><b>pid</b></b><ul compact><li>The <b>pid</b> argument is a process ID.</ul>
54<b><b>tid</b></b><ul compact><li>The <b>tid</b> argument is a thread ID.</ul>
55<b><b>buf</b></b><ul compact><li><a name="2"><!--meow--></a>
56The <b>buf</b> argument is character array of at least
57DB_THREADID_STRLEN bytes in length, into which the identifier
58pair should be formatted.</ul>
59<br>
60<br>
61<p>If no <b>thread_id_string</b> function is specified, the default
62routine displays the identifier pair as "pid/tid", that is, the process
63ID represented as an unsigned integer value, a slash ('/') character,
64then the thread ID represented as an unsigned integer value.</p>
65<br><b>Errors</b>
66<p>The DB_ENV-&gt;set_thread_id_string method
67may fail and return one of the following non-zero errors:</p>
68<br>
69<b>EINVAL</b><ul compact><li>An
70invalid flag value or parameter was specified.</ul>
71<br>
72<hr size=1 noshade>
73<br><b>Class</b>
74<a href="../api_c/env_class.html">DB_ENV</a>
75<br><b>See Also</b>
76<a href="../api_c/env_list.html">Database Environments and Related Methods</a>
77</tt>
78<table width="100%"><tr><td><br></td><td align=right>
79<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a>
80</td></tr></table>
81<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
82</body>
83</html>
84