~ubuntu-branches/ubuntu/edgy/rpm/edgy

« back to all changes in this revision

Viewing changes to db/docs/api_c/memp_sync.html

  • Committer: Bazaar Package Importer
  • Author(s): Joey Hess
  • Date: 2002-01-22 20:56:57 UTC
  • Revision ID: james.westby@ubuntu.com-20020122205657-l74j50mr9z8ofcl5
Tags: upstream-4.0.3
ImportĀ upstreamĀ versionĀ 4.0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!--$Id: memp_sync.so,v 10.27 2001/04/02 20:10:08 bostic Exp $-->
 
2
<!--Copyright 1997-2001 by Sleepycat Software, Inc.-->
 
3
<!--All rights reserved.-->
 
4
<html>
 
5
<head>
 
6
<title>Berkeley DB: memp_sync</title>
 
7
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
 
8
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
 
9
</head>
 
10
<body bgcolor=white>
 
11
<a name="2"><!--meow--></a>
 
12
<table width="100%"><tr valign=top>
 
13
<td>
 
14
<h1>memp_sync</h1>
 
15
</td>
 
16
<td align=right>
 
17
<a href="../api_c/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
 
18
</td></tr></table>
 
19
<hr size=1 noshade>
 
20
<tt>
 
21
<h3><pre>
 
22
#include &lt;db.h&gt;
 
23
<p>
 
24
int
 
25
memp_sync(DB_ENV *env, DB_LSN *lsn);
 
26
</pre></h3>
 
27
<h1>Description</h1>
 
28
<p>The memp_sync function ensures that any modified pages in the pool with
 
29
log sequence numbers less than the <b>lsn</b> argument are written to
 
30
disk.  If <b>lsn</b> is NULL, all modified pages in the pool are
 
31
flushed.
 
32
<p>The primary purpose of the memp_sync function is to enable a
 
33
transaction manager to ensure, as part of a checkpoint, that all pages
 
34
modified by a certain time have been written to disk.  Pages in the pool
 
35
that cannot be written back to disk immediately (for example, pages that
 
36
are currently pinned) are written to disk as soon as it is possible to
 
37
do so.  The expected behavior of the Berkeley DB or other Transaction
 
38
subsystem is to call the memp_sync function and then, if the
 
39
return indicates that some pages could not be written immediately, to
 
40
wait briefly and retry again with the same log sequence number until
 
41
the memp_sync function returns that all pages have been
 
42
written.
 
43
<p>To support the memp_sync functionality, it is necessary that the
 
44
pool functions know the location of the log sequence number on the page
 
45
for each file type.  This location should be specified when the file is
 
46
opened using the <a href="../api_c/memp_fopen.html">memp_fopen</a> function.  It is not required that
 
47
the log sequence number be aligned on the page in any way.
 
48
<p>The memp_sync function returns a non-zero error value on failure, 0 on success, and returns <a href="../api_c/memp_fsync.html#DB_INCOMPLETE">DB_INCOMPLETE</a> if there were pages which need to be
 
49
written but that memp_sync was unable to write immediately.
 
50
In addition, if memp_sync returns success, the value of
 
51
<b>lsn</b> will be overwritten with the largest log sequence number
 
52
from any page that was written by memp_sync to satisfy this
 
53
request.
 
54
<h1>Errors</h1>
 
55
<p>The memp_sync function may fail and return a non-zero error for the following conditions:
 
56
<p><dl compact>
 
57
<p><dt>EINVAL<dd>An invalid flag value or parameter was specified.
 
58
<p>The memp_sync function was called without logging having been
 
59
initialized in the environment.
 
60
</dl>
 
61
<p>The memp_sync function may fail and return a non-zero error for errors specified for other Berkeley DB and C library or system functions.
 
62
If a catastrophic error has occurred, the memp_sync function may fail and return
 
63
<a href="../ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a>, in which case all subsequent Berkeley DB calls will fail
 
64
in the same way.
 
65
<h1>See Also</h1>
 
66
<a href="../api_c/env_set_cachesize.html">DB_ENV-&gt;set_cachesize</a>,
 
67
<a href="../api_c/env_set_mp_mmapsize.html">DB_ENV-&gt;set_mp_mmapsize</a>,
 
68
<a href="../api_c/memp_fclose.html">memp_fclose</a>,
 
69
<a href="../api_c/memp_fget.html">memp_fget</a>,
 
70
<a href="../api_c/memp_fopen.html">memp_fopen</a>,
 
71
<a href="../api_c/memp_fput.html">memp_fput</a>,
 
72
<a href="../api_c/memp_fset.html">memp_fset</a>,
 
73
<a href="../api_c/memp_fsync.html">memp_fsync</a>,
 
74
<a href="../api_c/memp_register.html">memp_register</a>,
 
75
<a href="../api_c/memp_stat.html">memp_stat</a>,
 
76
<a href="../api_c/memp_sync.html">memp_sync</a>,
 
77
and
 
78
<a href="../api_c/memp_trickle.html">memp_trickle</a>.
 
79
</tt>
 
80
<table width="100%"><tr><td><br></td><td align=right>
 
81
<a href="../api_c/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
 
82
</td></tr></table>
 
83
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>
 
84
</body>
 
85
</html>