| 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::fd()</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="db.html" title="Chapter 2. The Db Handle" /> |
| 11 | <link rel="prev" href="dbexists.html" title="Db::exists()" /> |
| 12 | <link rel="next" href="dbget.html" title="Db::get()" /> |
| 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::fd()</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="dbexists.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Chapter 2. |
| 26 | The Db Handle |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="dbget.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="dbfd"></a>Db::fd()</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <pre class="programlisting">#include <db_cxx.h> |
| 42 | |
| 43 | int |
| 44 | Db::fd(int *fdp);</pre> |
| 45 | <p> |
| 46 | The <code class="methodname">Db::fd()</code> method provides access to a file descriptor |
| 47 | representative of the underlying database. A file descriptor |
| 48 | referring to the same file will be returned to all processes that call |
| 49 | <a class="xref" href="dbopen.html" title="Db::open()">Db::open()</a> with the same |
| 50 | <span class="bold"><strong>file</strong></span> parameter. |
| 51 | </p> |
| 52 | <p> |
| 53 | This file descriptor may be safely used as a parameter to the |
| 54 | <span class="bold"><strong>fcntl</strong></span>(2) and <span class="bold"><strong>flock</strong></span>(2) locking functions. |
| 55 | </p> |
| 56 | <p> |
| 57 | The <code class="methodname">Db::fd()</code> method only supports a coarse-grained form of locking. |
| 58 | Applications should instead use the Berkeley DB lock manager where |
| 59 | possible. |
| 60 | </p> |
| 61 | <p> |
| 62 | The <code class="methodname">Db::fd()</code> <span> |
| 63 | |
| 64 | <span> |
| 65 | method either returns a non-zero error value or throws an |
| 66 | exception that encapsulates a non-zero error value on |
| 67 | failure, and returns 0 on success. |
| 68 | </span> |
| 69 | </span> |
| 70 | </p> |
| 71 | <div class="sect2" lang="en" xml:lang="en"> |
| 72 | <div class="titlepage"> |
| 73 | <div> |
| 74 | <div> |
| 75 | <h3 class="title"><a id="idp1244280"></a>Parameters</h3> |
| 76 | </div> |
| 77 | </div> |
| 78 | </div> |
| 79 | <div class="sect3" lang="en" xml:lang="en"> |
| 80 | <div class="titlepage"> |
| 81 | <div> |
| 82 | <div> |
| 83 | <h4 class="title"><a id="idp1695888"></a>fdp</h4> |
| 84 | </div> |
| 85 | </div> |
| 86 | </div> |
| 87 | <p> |
| 88 | The <span class="bold"><strong>fdp</strong></span> parameter references memory |
| 89 | into which the current file descriptor is copied. |
| 90 | </p> |
| 91 | </div> |
| 92 | </div> |
| 93 | <div class="sect2" lang="en" xml:lang="en"> |
| 94 | <div class="titlepage"> |
| 95 | <div> |
| 96 | <div> |
| 97 | <h3 class="title"><a id="idm433288"></a>Class</h3> |
| 98 | </div> |
| 99 | </div> |
| 100 | </div> |
| 101 | <p> |
| 102 | <a class="link" href="db.html" title="Chapter 2. The Db Handle">Db</a> |
| 103 | </p> |
| 104 | </div> |
| 105 | <div class="sect2" lang="en" xml:lang="en"> |
| 106 | <div class="titlepage"> |
| 107 | <div> |
| 108 | <div> |
| 109 | <h3 class="title"><a id="idp388120"></a>See Also</h3> |
| 110 | </div> |
| 111 | </div> |
| 112 | </div> |
| 113 | <p> |
| 114 | <a class="xref" href="db.html#dblist" title="Database and Related Methods">Database and Related Methods</a> |
| 115 | </p> |
| 116 | </div> |
| 117 | </div> |
| 118 | <div class="navfooter"> |
| 119 | <hr /> |
| 120 | <table width="100%" summary="Navigation footer"> |
| 121 | <tr> |
| 122 | <td width="40%" align="left"><a accesskey="p" href="dbexists.html">Prev</a> </td> |
| 123 | <td width="20%" align="center"> |
| 124 | <a accesskey="u" href="db.html">Up</a> |
| 125 | </td> |
| 126 | <td width="40%" align="right"> <a accesskey="n" href="dbget.html">Next</a></td> |
| 127 | </tr> |
| 128 | <tr> |
| 129 | <td width="40%" align="left" valign="top">Db::exists() </td> |
| 130 | <td width="20%" align="center"> |
| 131 | <a accesskey="h" href="index.html">Home</a> |
| 132 | </td> |
| 133 | <td width="40%" align="right" valign="top"> Db::get()</td> |
| 134 | </tr> |
| 135 | </table> |
| 136 | </div> |
| 137 | </body> |
| 138 | </html> |