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