Import BSDDB 4.7.25 (as of svn r89086)
This commit is contained in:
104
docs/api_c/memp_fopen.html
Normal file
104
docs/api_c/memp_fopen.html
Normal file
@@ -0,0 +1,104 @@
|
||||
<!--$Id: memp_fopen.html 63573 2008-05-23 21:43:21Z trent.nelson $-->
|
||||
<!--Copyright (c) 1997,2008 Oracle. All rights reserved.-->
|
||||
<!--See the file LICENSE for redistribution information.-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Berkeley DB: DB_MPOOLFILE->open</title>
|
||||
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
|
||||
<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
|
||||
</head>
|
||||
<body bgcolor=white>
|
||||
<table width="100%"><tr valign=top>
|
||||
<td>
|
||||
<b>DB_MPOOLFILE->open</b>
|
||||
</td>
|
||||
<td align=right>
|
||||
<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></td>
|
||||
</tr></table>
|
||||
<hr size=1 noshade>
|
||||
<tt>
|
||||
<b><pre>
|
||||
#include <db.h>
|
||||
<p>
|
||||
int
|
||||
DB_MPOOLFILE->open(DB_MPOOLFILE *mpf,
|
||||
char *file, u_int32_t flags, int mode, size_t pagesize);
|
||||
</pre></b>
|
||||
<hr size=1 noshade>
|
||||
<b>Description: DB_MPOOLFILE->open</b>
|
||||
<p>The DB_MPOOLFILE->open method opens a file in the shared memory buffer pool.</p>
|
||||
<p>The DB_MPOOLFILE->open method
|
||||
returns a non-zero error value on failure
|
||||
and 0 on success.
|
||||
</p>
|
||||
<b>Parameters</b> <br>
|
||||
<b>file</b><ul compact><li>The <b>file</b> parameter is the name of the file to be opened. If
|
||||
<b>file</b> is NULL, a private temporary file is created that
|
||||
cannot be shared with any other process (although it may be shared with
|
||||
other threads of control in the same process).</ul>
|
||||
<p>When using a Unicode build on Windows (the default), the <b>file</b>
|
||||
argument will be interpreted as a UTF-8 string, which is equivalent to
|
||||
ASCII for Latin characters.</p>
|
||||
<b>flags</b><ul compact><li>The <b>flags</b> parameter must be set to 0 or by bitwise inclusively <b>OR</b>'ing together one
|
||||
or more of the following values:
|
||||
<br>
|
||||
<b><a name="DB_CREATE">DB_CREATE</a></b><ul compact><li>Create any underlying files, as necessary. If the files do not already
|
||||
exist and the DB_CREATE flag is not specified, the call will
|
||||
fail.</ul>
|
||||
<a name="2"><!--meow--></a>
|
||||
<b><a name="DB_DIRECT">DB_DIRECT</a></b><ul compact><li>If set and supported by the system, turn off system buffering of the
|
||||
file to avoid double caching.</ul>
|
||||
<b><a name="DB_MULTIVERSION">DB_MULTIVERSION</a></b><ul compact><li>Open the file with support for <a href="../ref/transapp/read.html">multiversion concurrency control</a>. Calls to <a href="../api_c/memp_fget.html">DB_MPOOLFILE->get</a> which
|
||||
dirty pages will cause copies to be made in the cache.</ul>
|
||||
<b><a name="DB_NOMMAP">DB_NOMMAP</a></b><ul compact><li>Always copy this file into the local cache instead of potentially mapping
|
||||
it into process memory (see the description of the
|
||||
<a href="../api_c/env_set_mp_mmapsize.html">DB_ENV->set_mp_mmapsize</a> method for further information).</ul>
|
||||
<b><a name="DB_ODDFILESIZE">DB_ODDFILESIZE</a></b><ul compact><li>Attempts to open files which are not a multiple of the page size in
|
||||
length will fail, by default. If the DB_ODDFILESIZE flag is
|
||||
set, any partial page at the end of the file will be ignored and the
|
||||
open will proceed.</ul>
|
||||
<b><a name="DB_RDONLY">DB_RDONLY</a></b><ul compact><li>Open any underlying files for reading only. Any attempt to write the file
|
||||
using the pool functions will fail, regardless of the actual permissions
|
||||
of the file.</ul>
|
||||
<br></ul>
|
||||
<b>mode</b><ul compact><li>On Windows systems, the mode parameter is ignored.
|
||||
<p>On UNIX systems or in IEEE/ANSI Std 1003.1 (POSIX) environments, files created by DB_MPOOLFILE->open
|
||||
are created with mode <b>mode</b> (as described in <b>chmod</b>(2))
|
||||
and modified by the process' umask value at the time of creation (see
|
||||
<b>umask</b>(2)). Created files are owned by the process owner; the
|
||||
group ownership of created files is based on the system and directory
|
||||
defaults, and is not further specified by Berkeley DB. System shared memory
|
||||
segments created by DB_MPOOLFILE->open are created with mode <b>mode</b>, unmodified
|
||||
by the process' umask value. If <b>mode</b> is 0, DB_MPOOLFILE->open will use a
|
||||
default mode of readable and writable by both owner and group.</p></ul>
|
||||
<b>pagesize</b><ul compact><li>The <b>pagesize</b> parameter is the size, in bytes, of the unit of
|
||||
transfer between the application and the cache, although it is not
|
||||
necessarily the unit of transfer between the cache and the underlying
|
||||
filesystem.</ul>
|
||||
<br>
|
||||
<br><b>Errors</b>
|
||||
<p>The DB_MPOOLFILE->open method
|
||||
may fail and return one of the following non-zero errors:</p>
|
||||
<br>
|
||||
<b>EINVAL</b><ul compact><li>If the file has already been entered into the pool, and the <b>pagesize</b>
|
||||
value is not the same as when the file was entered into the pool, or the
|
||||
length of the file is not zero or a multiple of the <b>pagesize</b>;
|
||||
the DB_RDONLY flag was specified for an in-memory pool; or if an
|
||||
invalid flag value or parameter was specified.</ul>
|
||||
<br>
|
||||
<br>
|
||||
<b>ENOMEM</b><ul compact><li>The maximum number of open files has been reached.</ul>
|
||||
<br>
|
||||
<hr size=1 noshade>
|
||||
<br><b>Class</b>
|
||||
<a href="../api_c/env_class.html">DB_ENV</a>, <a href="../api_c/mempfile_class.html">DB_MPOOLFILE</a>
|
||||
<br><b>See Also</b>
|
||||
<a href="../api_c/memp_list.html">Memory Pools and Related Methods</a>
|
||||
</tt>
|
||||
<table width="100%"><tr><td><br></td><td align=right>
|
||||
<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>
|
||||
</td></tr></table>
|
||||
<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user