1<!--$Id: memp_set_maxsize.so,v 1.15 2005/09/17 16:30:18 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB: DB_MPOOLFILE->set_maxsize</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<table width="100%"><tr valign=top> 12<td> 13<b>DB_MPOOLFILE->set_maxsize</b> 14</td> 15<td align=right> 16<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a> 17<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td> 18</tr></table> 19<hr size=1 noshade> 20<tt> 21<b><pre> 22#include <db.h> 23<p> 24int 25DB_MPOOLFILE->set_maxsize(DB_MPOOLFILE *mpf, 26 u_int32_t gbytes, u_int32_t bytes); 27<p> 28int 29DB_MPOOLFILE->get_maxsize(DB_MPOOLFILE *mpf, 30 u_int32_t *gbytesp, u_int32_t *bytesp); 31</pre></b> 32<hr size=1 noshade> 33<b>Description: DB_MPOOLFILE->set_maxsize</b> 34<p>Set the maximum size for the file to be <b>gbytes</b> gigabytes plus 35<b>bytes</b>. Attempts to allocate new pages in the file after the 36limit has been reached will fail.</p> 37<p>To set the maximum file size for a particular database, call the 38DB_MPOOLFILE->set_maxsize method using the <a href="../api_c/mempfile_class.html">DB_MPOOLFILE</a> handle stored 39in the <b>mpf</b> field of the <a href="../api_c/db_class.html">DB</a> handle. Attempts to insert 40new items into the database after the limit has been reached may fail.</p> 41<p>The DB_MPOOLFILE->set_maxsize method configures a file in the memory pool, not only 42operations performed using the specified <a href="../api_c/mempfile_class.html">DB_MPOOLFILE</a> handle.</p> 43<p>The DB_MPOOLFILE->set_maxsize method may be called at any time during the life of the 44application.</p> 45<p>The DB_MPOOLFILE->set_maxsize method 46returns a non-zero error value on failure 47and 0 on success. 48</p> 49<b>Parameters</b> <br> 50 <b>bytes</b><ul compact><li>The maximum size of the file is set to <b>gbytes</b> gigabytes plus 51<b>bytes</b>.</ul> 52 <b>gbytes</b><ul compact><li>The maximum size of the file is set to <b>gbytes</b> gigabytes plus 53<b>bytes</b>.</ul> 54<br> 55<hr size=1 noshade> 56<b>Description: DB_MPOOLFILE->get_maxsize</b> 57<p>The DB_MPOOLFILE->get_maxsize method 58returns a non-zero error value on failure 59and 0 on success. 60</p> 61<p>The DB_MPOOLFILE->get_maxsize method may be called at any time during the life of the 62application.</p> 63<b>Parameters</b> <br> 64 <b>bytesp</b><ul compact><li>The <b>bytesp</b> parameter references memory into which 65 the additional bytes of memory in the maximum file size is copied.</ul> 66 <b>gbytesp</b><ul compact><li>The <b>gbytesp</b> parameter references memory into which 67 the gigabytes of memory in the maximum file size is copied.</ul> 68<br> 69<hr size=1 noshade> 70<br><b>Class</b> 71<a href="../api_c/env_class.html">DB_ENV</a>, <a href="../api_c/mempfile_class.html">DB_MPOOLFILE</a> 72<br><b>See Also</b> 73<a href="../api_c/memp_list.html">Memory Pools and Related Methods</a> 74</tt> 75<table width="100%"><tr><td><br></td><td align=right> 76<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a> 77</td></tr></table> 78<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 79</body> 80</html> 81