1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <title>DB_ENV->set_thread_id_string()</title> 7 <link rel="stylesheet" href="apiReference.css" type="text/css" /> 8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> 9 <link rel="start" href="index.html" title="Berkeley DB C API Reference" /> 10 <link rel="up" href="env.html" title="Chapter��5.�� The DB_ENV Handle" /> 11 <link rel="prev" href="envset_thread_id.html" title="DB_ENV->set_thread_id()" /> 12 <link rel="next" href="envset_timeout.html" title="DB_ENV->set_timeout()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DB_ENV->set_thread_id_string()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="envset_thread_id.html">Prev</a>��</td> 22 <th width="60%" align="center">Chapter��5.�� 23 The DB_ENV Handle 24 </th> 25 <td width="20%" align="right">��<a accesskey="n" href="envset_timeout.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="envset_thread_id_string"></a>DB_ENV->set_thread_id_string()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db.h> 39 40int 41DB_ENV->set_thread_id_string(DB_ENV *dbenv, 42 char *(*thread_id_string)(DB_ENV *dbenv, 43 pid_t pid, db_threadid_t tid, char *buf)); </pre> 44 <p> 45 Declare a function that formats a process ID and thread ID identifier 46 pair for display into a caller-supplied buffer. The function must 47 return a reference to the caller-specified buffer. The 48 <code class="methodname">DB_ENV->set_thread_id_string()</code> method supports the 49 <a class="xref" href="envset_thread_id.html" title="DB_ENV->set_thread_id()">DB_ENV->set_thread_id()</a> 50 method. 51 </p> 52 <p> 53 The <code class="methodname">DB_ENV->set_thread_id_string()</code> method configures operations 54 performed using the specified <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a> 55 handle, not all operations performed on the underlying database environment. 56 </p> 57 <p> 58 The <code class="methodname">DB_ENV->set_thread_id_string()</code> method may be called at any time 59 during the life of the application. 60 </p> 61 <p> 62 The <code class="methodname">DB_ENV->set_thread_id_string()</code> <span> 63 <span> 64 method returns a non-zero error value on failure and 0 on success. 65 </span> 66 67 </span> 68 </p> 69 <div class="sect2" lang="en" xml:lang="en"> 70 <div class="titlepage"> 71 <div> 72 <div> 73 <h3 class="title"><a id="id1672463"></a>Parameters</h3> 74 </div> 75 </div> 76 </div> 77 <div class="sect3" lang="en" xml:lang="en"> 78 <div class="titlepage"> 79 <div> 80 <div> 81 <h4 class="title"><a id="id1672468"></a>thread_id_string</h4> 82 </div> 83 </div> 84 </div> 85 <p> 86 The <span class="bold"><strong>thread_id_string</strong></span> parameter is a 87 function which returns a buffer in which is an identifier pair 88 formatted for display. The function takes four arguments: 89 </p> 90 <div class="itemizedlist"> 91 <ul type="disc"> 92 <li> 93 <p> 94 <code class="literal">dbenv</code> 95 </p> 96 <p> 97 The <span class="bold"><strong>dbenv</strong></span> parameter is the enclosing database 98 environment handle, allowing application access to the application-private 99 fields of that object. 100 </p> 101 </li> 102 <li> 103 <p> 104 <code class="literal">pid</code> 105 </p> 106 <p> 107 The <span class="bold"><strong>pid</strong></span> argument is a process ID. 108 </p> 109 </li> 110 <li> 111 <p> 112 <code class="literal">tid</code> 113 </p> 114 <p> 115 The <span class="bold"><strong>tid</strong></span> argument is a thread ID. 116 </p> 117 </li> 118 <li> 119 <p> 120 <code class="literal">buf</code> 121 </p> 122 <p> 123 The <span class="bold"><strong>buf</strong></span> argument is character array of at least 124 DB_THREADID_STRLEN bytes in length, into which the identifier pair should be 125 formatted. 126 </p> 127 </li> 128 </ul> 129 </div> 130 <p> 131 If no <span class="bold"><strong>thread_id_string</strong></span> function is specified, the default 132 routine displays the identifier pair as "pid/tid", that is, the process ID represented as 133 an unsigned integer value, a slash ('/') character, then the thread ID represented as an 134 unsigned integer value. 135 </p> 136 </div> 137 </div> 138 <div class="sect2" lang="en" xml:lang="en"> 139 <div class="titlepage"> 140 <div> 141 <div> 142 <h3 class="title"><a id="id1672797"></a>Errors</h3> 143 </div> 144 </div> 145 </div> 146 <p> 147 The <code class="methodname">DB_ENV->set_thread_id_string()</code> <span> 148 <span> 149 method may fail and return one of the following non-zero errors: 150 </span> 151 152 </span> 153 </p> 154 <div class="sect3" lang="en" xml:lang="en"> 155 <div class="titlepage"> 156 <div> 157 <div> 158 <h4 class="title"><a id="id1672671"></a>EINVAL</h4> 159 </div> 160 </div> 161 </div> 162 <p> 163 An invalid flag value or parameter was specified. 164 </p> 165 </div> 166 </div> 167 <div class="sect2" lang="en" xml:lang="en"> 168 <div class="titlepage"> 169 <div> 170 <div> 171 <h3 class="title"><a id="id1672685"></a>Class</h3> 172 </div> 173 </div> 174 </div> 175 <p> 176 <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a> 177 </p> 178 </div> 179 <div class="sect2" lang="en" xml:lang="en"> 180 <div class="titlepage"> 181 <div> 182 <div> 183 <h3 class="title"><a id="id1672784"></a>See Also</h3> 184 </div> 185 </div> 186 </div> 187 <p> 188 <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a> 189 </p> 190 </div> 191 </div> 192 <div class="navfooter"> 193 <hr /> 194 <table width="100%" summary="Navigation footer"> 195 <tr> 196 <td width="40%" align="left"><a accesskey="p" href="envset_thread_id.html">Prev</a>��</td> 197 <td width="20%" align="center"> 198 <a accesskey="u" href="env.html">Up</a> 199 </td> 200 <td width="40%" align="right">��<a accesskey="n" href="envset_timeout.html">Next</a></td> 201 </tr> 202 <tr> 203 <td width="40%" align="left" valign="top">DB_ENV->set_thread_id()��</td> 204 <td width="20%" align="center"> 205 <a accesskey="h" href="index.html">Home</a> 206 </td> 207 <td width="40%" align="right" valign="top">��DB_ENV->set_timeout()</td> 208 </tr> 209 </table> 210 </div> 211 </body> 212</html> 213