| 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_func_ioinfo</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="setfunc.html" title="Appendix C. Berkeley DB Application Space Static Functions" /> |
| 11 | <link rel="prev" href="db_env_set_func_ftruncate.html" title="db_env_set_func_ftruncate" /> |
| 12 | <link rel="next" href="db_env_set_func_malloc.html" title="db_env_set_func_malloc" /> |
| 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_func_ioinfo</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="db_env_set_func_ftruncate.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Appendix C. |
| 26 | Berkeley DB Application Space Static Functions |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="db_env_set_func_malloc.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="db_env_set_func_ioinfo"></a>db_env_set_func_ioinfo</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <pre class="programlisting">#include <db.h> |
| 42 | |
| 43 | int |
| 44 | db_env_set_func_ioinfo(int (*func_ioinfo)(const char *path, |
| 45 | int fd, u_int32_t *mbytesp, u_int32_t *bytesp, u_int32_t *iosizep)); </pre> |
| 46 | <p> |
| 47 | The Berkeley DB library requires the ability to determine the size and |
| 48 | I/O characteristics of a file. |
| 49 | </p> |
| 50 | <p> |
| 51 | The <code class="function">db_env_set_func_ioinfo()</code> function configures all operations performed |
| 52 | by a process and all of its threads of control, not operations |
| 53 | confined to a single database environment. |
| 54 | </p> |
| 55 | <p> |
| 56 | Although the <code class="function">db_env_set_func_ioinfo()</code> function may be called at any time |
| 57 | during the life of the application, it should normally be called |
| 58 | before making calls to the <a class="xref" href="envcreate.html" title="db_env_create">db_env_create</a> or |
| 59 | <a class="xref" href="dbcreate.html" title="db_create">db_create</a> methods. |
| 60 | </p> |
| 61 | <p> |
| 62 | The <code class="function">db_env_set_func_ioinfo()</code> <span> |
| 63 | function returns a non-zero error value on failure and 0 on success. |
| 64 | </span> |
| 65 | </p> |
| 66 | <div class="sect2" lang="en" xml:lang="en"> |
| 67 | <div class="titlepage"> |
| 68 | <div> |
| 69 | <div> |
| 70 | <h3 class="title"><a id="idp55638192"></a>Parameters</h3> |
| 71 | </div> |
| 72 | </div> |
| 73 | </div> |
| 74 | <div class="sect3" lang="en" xml:lang="en"> |
| 75 | <div class="titlepage"> |
| 76 | <div> |
| 77 | <div> |
| 78 | <h4 class="title"><a id="idp55638384"></a>func_ioinfo</h4> |
| 79 | </div> |
| 80 | </div> |
| 81 | </div> |
| 82 | <p> |
| 83 | The <span class="bold"><strong>func_ioinfo</strong></span> parameter is the |
| 84 | function which returns the size and I/O characteristics of a file. |
| 85 | </p> |
| 86 | <p> |
| 87 | The <span class="bold"><strong>path</strong></span> parameter is the pathname of |
| 88 | the file to be checked, and the <span class="bold"><strong>fd</strong></span> |
| 89 | parameter is an open file descriptor on the file. |
| 90 | </p> |
| 91 | <p> |
| 92 | If the <span class="bold"><strong>mbytesp</strong></span> and <span class="bold"><strong>bytesp</strong></span> parameters are non-NULL, the <span class="bold"><strong>ioinfo</strong></span> function must return in them the size of |
| 93 | the file: the number of megabytes in the file into the memory location |
| 94 | to which the <span class="bold"><strong>mbytesp</strong></span> parameter |
| 95 | refers, and the number of bytes over and above that number of |
| 96 | megabytes into the memory location to which the <span class="bold"><strong>bytesp</strong></span> parameter refers. |
| 97 | </p> |
| 98 | <p> |
| 99 | In addition, if the <span class="bold"><strong>iosizep</strong></span> parameter |
| 100 | is non-NULL, the <span class="bold"><strong>ioinfo</strong></span> function must |
| 101 | return the optimum granularity for I/O operations to the file into the |
| 102 | memory location to which it refers. |
| 103 | </p> |
| 104 | <p> |
| 105 | The <span class="bold"><strong>func_ioinfo</strong></span> function must return |
| 106 | the value of <span class="bold"><strong>errno</strong></span> on failure and 0 |
| 107 | on success. |
| 108 | </p> |
| 109 | </div> |
| 110 | </div> |
| 111 | <div class="sect2" lang="en" xml:lang="en"> |
| 112 | <div class="titlepage"> |
| 113 | <div> |
| 114 | <div> |
| 115 | <h3 class="title"><a id="idp55632920"></a>See Also</h3> |
| 116 | </div> |
| 117 | </div> |
| 118 | </div> |
| 119 | <p> |
| 120 | <a href="../../programmer_reference/program_runtime.html" class="olink">Run-time configuration</a> |
| 121 | |
| 122 | </p> |
| 123 | </div> |
| 124 | </div> |
| 125 | <div class="navfooter"> |
| 126 | <hr /> |
| 127 | <table width="100%" summary="Navigation footer"> |
| 128 | <tr> |
| 129 | <td width="40%" align="left"><a accesskey="p" href="db_env_set_func_ftruncate.html">Prev</a> </td> |
| 130 | <td width="20%" align="center"> |
| 131 | <a accesskey="u" href="setfunc.html">Up</a> |
| 132 | </td> |
| 133 | <td width="40%" align="right"> <a accesskey="n" href="db_env_set_func_malloc.html">Next</a></td> |
| 134 | </tr> |
| 135 | <tr> |
| 136 | <td width="40%" align="left" valign="top">db_env_set_func_ftruncate </td> |
| 137 | <td width="20%" align="center"> |
| 138 | <a accesskey="h" href="index.html">Home</a> |
| 139 | </td> |
| 140 | <td width="40%" align="right" valign="top"> db_env_set_func_malloc</td> |
| 141 | </tr> |
| 142 | </table> |
| 143 | </div> |
| 144 | </body> |
| 145 | </html> |