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_MPOOLFILE->set_maxsize()</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="memp.html" title="Chapter 8. The DB_MPOOLFILE Handle" /> 11 <link rel="prev" href="mempset_lsn_offset.html" title="DB_MPOOLFILE->set_lsn_offset()" /> 12 <link rel="next" href="mempset_pgcookie.html" title="DB_MPOOLFILE->set_pgcookie()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DB_MPOOLFILE->set_maxsize()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="mempset_lsn_offset.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 8. 23 The DB_MPOOLFILE Handle 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="mempset_pgcookie.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="mempset_maxsize"></a>DB_MPOOLFILE->set_maxsize()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db.h> 39 40int 41DB_MPOOLFILE->set_maxsize(DB_MPOOLFILE *mpf, 42 u_int32_t gbytes, u_int32_t bytes); </pre> 43 <p> 44 Set the maximum size for the file to be <span class="bold"><strong>gbytes</strong></span> gigabytes plus <span class="bold"><strong>bytes</strong></span>. Attempts to allocate new pages in the 45 file after the limit has been reached will fail. 46 </p> 47 <p> 48 To set the maximum file size for a particular database, call the 49 <code class="methodname">DB_MPOOLFILE->set_maxsize()</code> method using the 50 <a class="link" href="memp.html" title="Chapter 8. The DB_MPOOLFILE Handle">DB_MPOOLFILE</a> handle stored 51 in the <span class="bold"><strong>mpf</strong></span> field of the 52 <a class="link" href="db.html" title="Chapter 2. The DB Handle">DB</a> handle. Attempts to insert 53 new items into the database after the limit has been reached may fail. 54 </p> 55 <p> 56 The <code class="methodname">DB_MPOOLFILE->set_maxsize()</code> method configures a file in the 57 cache, not only operations performed using the specified 58 <a class="link" href="memp.html" title="Chapter 8. The DB_MPOOLFILE Handle">DB_MPOOLFILE</a> handle. 59 </p> 60 <p> 61 The <code class="methodname">DB_MPOOLFILE->set_maxsize()</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_MPOOLFILE->set_maxsize()</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="id1692760"></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="id1692699"></a>bytes</h4> 85 </div> 86 </div> 87 </div> 88 <p> 89 The maximum size of the file is set to <span class="bold"><strong>gbytes</strong></span> gigabytes plus <span class="bold"><strong>bytes</strong></span>. 90 </p> 91 </div> 92 <div class="sect3" lang="en" xml:lang="en"> 93 <div class="titlepage"> 94 <div> 95 <div> 96 <h4 class="title"><a id="id1692912"></a>gbytes</h4> 97 </div> 98 </div> 99 </div> 100 <p> 101 The maximum size of the file is set to <span class="bold"><strong>gbytes</strong></span> gigabytes plus <span class="bold"><strong>bytes</strong></span>. 102 </p> 103 </div> 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="id1692842"></a>Class</h3> 110 </div> 111 </div> 112 </div> 113 <p> 114 <a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a>, <a class="link" href="memp.html" title="Chapter 8. The DB_MPOOLFILE Handle">DB_MPOOLFILE</a> 115 </p> 116 </div> 117 <div class="sect2" lang="en" xml:lang="en"> 118 <div class="titlepage"> 119 <div> 120 <div> 121 <h3 class="title"><a id="id1692790"></a>See Also</h3> 122 </div> 123 </div> 124 </div> 125 <p> 126 <a class="xref" href="memp.html#memplist" title="Memory Pools and Related Methods">Memory Pools and Related Methods</a> 127 </p> 128 </div> 129 </div> 130 <div class="navfooter"> 131 <hr /> 132 <table width="100%" summary="Navigation footer"> 133 <tr> 134 <td width="40%" align="left"><a accesskey="p" href="mempset_lsn_offset.html">Prev</a> </td> 135 <td width="20%" align="center"> 136 <a accesskey="u" href="memp.html">Up</a> 137 </td> 138 <td width="40%" align="right"> <a accesskey="n" href="mempset_pgcookie.html">Next</a></td> 139 </tr> 140 <tr> 141 <td width="40%" align="left" valign="top">DB_MPOOLFILE->set_lsn_offset() </td> 142 <td width="20%" align="center"> 143 <a accesskey="h" href="index.html">Home</a> 144 </td> 145 <td width="40%" align="right" valign="top"> DB_MPOOLFILE->set_pgcookie()</td> 146 </tr> 147 </table> 148 </div> 149 </body> 150</html> 151