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_clear_len()</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="mempget_priority.html" title="DB_MPOOLFILE->get_priority()" /> 12 <link rel="next" href="mempset_fileid.html" title="DB_MPOOLFILE->set_fileid()" /> 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_clear_len()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="mempget_priority.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_fileid.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_clear_len"></a>DB_MPOOLFILE->set_clear_len()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db.h> 39 40int 41DB_MPOOLFILE->set_clear_len(DB_MPOOLFILE *mpf, u_int32_t len); </pre> 42 <p> 43 The <code class="methodname">DB_MPOOLFILE->set_clear_len()</code> method sets the number of initial 44 bytes in a page that should be set to nul when the page is created as 45 a result of the 46 <a class="link" href="mempfget.html#mpoolfget_DB_MPOOL_CREATE">DB_MPOOL_CREATE</a> 47 or <a class="link" href="mempfget.html#mpoolfget_DB_MPOOL_NEW">DB_MPOOL_NEW</a> 48 flags specified to <a class="xref" href="mempfget.html" title="DB_MPOOLFILE->get()">DB_MPOOLFILE->get()</a>. If no 49 clear length is specified, the entire page is cleared when it is 50 created. 51 </p> 52 <p> 53 The <code class="methodname">DB_MPOOLFILE->set_clear_len()</code> method configures a file in the 54 cache, not only operations performed using the specified 55 <a class="link" href="memp.html" title="Chapter 8. The DB_MPOOLFILE Handle">DB_MPOOLFILE</a> handle. 56 </p> 57 <p> 58 The <code class="methodname">DB_MPOOLFILE->set_clear_len()</code> method may not be called after the 59 <a class="xref" href="mempfopen.html" title="DB_MPOOLFILE->open()">DB_MPOOLFILE->open()</a> 60 method is called. If the file is already open in the cache when 61 <a class="xref" href="mempfopen.html" title="DB_MPOOLFILE->open()">DB_MPOOLFILE->open()</a> is 62 called, the information specified to <code class="methodname">DB_MPOOLFILE->set_clear_len()</code> 63 must be consistent with the existing file or an error will be returned. 64 </p> 65 <p> 66 The <code class="methodname">DB_MPOOLFILE->set_clear_len()</code> <span> 67 <span> 68 method returns a non-zero error value on failure and 0 on success. 69 </span> 70 71 </span> 72 </p> 73 <div class="sect2" lang="en" xml:lang="en"> 74 <div class="titlepage"> 75 <div> 76 <div> 77 <h3 class="title"><a id="id1691928"></a>Parameters</h3> 78 </div> 79 </div> 80 </div> 81 <div class="sect3" lang="en" xml:lang="en"> 82 <div class="titlepage"> 83 <div> 84 <div> 85 <h4 class="title"><a id="id1691852"></a>len</h4> 86 </div> 87 </div> 88 </div> 89 <p> 90 The <span class="bold"><strong>len</strong></span> parameter is the number of 91 initial bytes in a page that should be set to nul when the page is 92 created. A value of 0 results in the entire page being set to nul 93 bytes. 94 </p> 95 </div> 96 </div> 97 <div class="sect2" lang="en" xml:lang="en"> 98 <div class="titlepage"> 99 <div> 100 <div> 101 <h3 class="title"><a id="id1691434"></a>Class</h3> 102 </div> 103 </div> 104 </div> 105 <p> 106 <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> 107 </p> 108 </div> 109 <div class="sect2" lang="en" xml:lang="en"> 110 <div class="titlepage"> 111 <div> 112 <div> 113 <h3 class="title"><a id="id1691638"></a>See Also</h3> 114 </div> 115 </div> 116 </div> 117 <p> 118 <a class="xref" href="memp.html#memplist" title="Memory Pools and Related Methods">Memory Pools and Related Methods</a> 119 </p> 120 </div> 121 </div> 122 <div class="navfooter"> 123 <hr /> 124 <table width="100%" summary="Navigation footer"> 125 <tr> 126 <td width="40%" align="left"><a accesskey="p" href="mempget_priority.html">Prev</a> </td> 127 <td width="20%" align="center"> 128 <a accesskey="u" href="memp.html">Up</a> 129 </td> 130 <td width="40%" align="right"> <a accesskey="n" href="mempset_fileid.html">Next</a></td> 131 </tr> 132 <tr> 133 <td width="40%" align="left" valign="top">DB_MPOOLFILE->get_priority() </td> 134 <td width="20%" align="center"> 135 <a accesskey="h" href="index.html">Home</a> 136 </td> 137 <td width="40%" align="right" valign="top"> DB_MPOOLFILE->set_fileid()</td> 138 </tr> 139 </table> 140 </div> 141 </body> 142</html> 143