mirror of
https://github.com/MariaDB/server.git
synced 2025-11-09 11:41:36 +03:00
87 lines
4.4 KiB
HTML
87 lines
4.4 KiB
HTML
<!--$Id: set_func_map.so,v 10.8 2000/05/31 15:10:01 bostic Exp $-->
|
|
<!--Copyright 1997, 1998, 1999, 2000 by Sleepycat Software, Inc.-->
|
|
<!--All rights reserved.-->
|
|
<html>
|
|
<head>
|
|
<title>Berkeley DB: db_env_set_func_map</title>
|
|
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
|
|
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
|
|
</head>
|
|
<body bgcolor=white>
|
|
<a name="2"><!--meow--></a>
|
|
<table><tr valign=top>
|
|
<td>
|
|
<h1>db_env_set_func_map</h1>
|
|
</td>
|
|
<td width="1%">
|
|
<a href="../api_c/c_index.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>
|
|
<h3><pre>
|
|
#include <db.h>
|
|
<p>
|
|
int
|
|
db_env_set_func_map(int (*func_map)(char *path,
|
|
size_t len, int is_region, int is_rdonly, void **addr));
|
|
</pre></h3>
|
|
<h1>Description</h1>
|
|
<p>The Berkeley DB library requires the ability to map a file into memory and to
|
|
create shared memory regions (which may or may not be backed by files).
|
|
The <b>func_map</b> argument must conform to the following interface:
|
|
<p><blockquote><pre>int map(char *path, size_t len,
|
|
int is_region, int is_rdonly, void **addr);</pre></blockquote>
|
|
<p>The <b>path</b> argument is the name of a file.
|
|
<p>The <b>is_region</b> argument will be zero if the intention is to map a
|
|
file into shared memory. In this case, the <b>map</b> function must map
|
|
the first <b>len</b> bytes of the file into memory and return a pointer
|
|
to the mapped location in the memory location referenced by the argument
|
|
<b>addr</b>. The <b>is_rdonly</b> argument will be non-zero if the file
|
|
is considered read-only by the caller.
|
|
<p>The <b>is_region</b> argument will be non-zero if the memory is intended
|
|
to be used as a shared memory region for synchronization between Berkeley DB
|
|
threads/processes. In this case, the returned memory may be of any kind
|
|
(e.g., anonymous), but must be able to support semaphores. In this case,
|
|
the <b>path</b> argument may be ignored (although future <b>map</b>
|
|
calls using the same <b>path</b> must return the same memory), and the
|
|
<b>is_rdonly</b> argument will always be zero.
|
|
<p>The <b>func_map</b> function must return the value of <b>errno</b> on
|
|
failure and 0 on success.
|
|
<p>The db_env_set_func_map interface affects the entire application, not a single
|
|
database or database environment.
|
|
<p>While the db_env_set_func_map interface may be used to configure Berkeley DB at any time
|
|
during the life of the application, it should normally be called before
|
|
making any calls to the <a href="../api_c/env_create.html">db_env_create</a> or <a href="../api_c/db_create.html">db_create</a> functions.
|
|
<p>The db_env_set_func_map function returns a non-zero error value on failure and 0 on success.
|
|
<h1>Errors</h1>
|
|
<p><dl compact>
|
|
<p><dt>EINVAL<dd>An invalid flag value or parameter was specified.
|
|
</dl>
|
|
<h1>See Also</h1>
|
|
<a href="../api_c/set_func_close.html">db_env_set_func_close</a>,
|
|
<a href="../api_c/set_func_dirfree.html">db_env_set_func_dirfree</a>,
|
|
<a href="../api_c/set_func_dirlist.html">db_env_set_func_dirlist</a>,
|
|
<a href="../api_c/set_func_exists.html">db_env_set_func_exists</a>,
|
|
<a href="../api_c/set_func_free.html">db_env_set_func_free</a>,
|
|
<a href="../api_c/set_func_fsync.html">db_env_set_func_fsync</a>,
|
|
<a href="../api_c/set_func_ioinfo.html">db_env_set_func_ioinfo</a>,
|
|
<a href="../api_c/set_func_malloc.html">db_env_set_func_malloc</a>,
|
|
<a href="../api_c/set_func_map.html">db_env_set_func_map</a>,
|
|
<a href="../api_c/set_func_open.html">db_env_set_func_open</a>,
|
|
<a href="../api_c/set_func_read.html">db_env_set_func_read</a>,
|
|
<a href="../api_c/set_func_realloc.html">db_env_set_func_realloc</a>,
|
|
<a href="../api_c/set_func_seek.html">db_env_set_func_seek</a>,
|
|
<a href="../api_c/set_func_sleep.html">db_env_set_func_sleep</a>,
|
|
<a href="../api_c/set_func_unlink.html">db_env_set_func_unlink</a>,
|
|
<a href="../api_c/set_func_unmap.html">db_env_set_func_unmap</a>,
|
|
<a href="../api_c/set_func_write.html">db_env_set_func_write</a>
|
|
and
|
|
<a href="../api_c/set_func_yield.html">db_env_set_func_yield</a>.
|
|
</tt>
|
|
<table><tr><td><br></td><td width="1%">
|
|
<a href="../api_c/c_index.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><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>
|
|
</body>
|
|
</html>
|