summaryrefslogtreecommitdiffstats
path: root/Modules/_bsddb.c
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2003-08-28 21:50:30 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2003-08-28 21:50:30 (GMT)
commit6676f6edc11bd3e3e1559a76aab22c6af6faf14e (patch)
treeb802aaf86757a65a91db5bb0187d74e144f6e72a /Modules/_bsddb.c
parent376e63d5cdb7388b5787ab10f7d82ba24257e742 (diff)
downloadcpython-6676f6edc11bd3e3e1559a76aab22c6af6faf14e.zip
cpython-6676f6edc11bd3e3e1559a76aab22c6af6faf14e.tar.gz
cpython-6676f6edc11bd3e3e1559a76aab22c6af6faf14e.tar.bz2
Support DBEnv.set_shm_key() to allow multi-threaded multi-process
database environments to use shared memory on systems supporting it.
Diffstat (limited to 'Modules/_bsddb.c')
-rw-r--r--Modules/_bsddb.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c
index 990c89f..dcbcdb3 100644
--- a/Modules/_bsddb.c
+++ b/Modules/_bsddb.c
@@ -3277,6 +3277,21 @@ DBEnv_set_timeout(DBEnvObject* self, PyObject* args, PyObject* kwargs)
#endif /* DBVER >= 40 */
static PyObject*
+DBEnv_set_shm_key(DBEnvObject* self, PyObject* args)
+{
+ int err;
+ long shm_key = 0;
+
+ if (!PyArg_ParseTuple(args, "l:set_shm_key", &shm_key))
+ return NULL;
+ CHECK_ENV_NOT_CLOSED(self);
+
+ err = self->db_env->set_shm_key(self->db_env, shm_key);
+ RETURN_IF_ERR();
+ RETURN_NONE();
+}
+
+static PyObject*
DBEnv_set_cachesize(DBEnvObject* self, PyObject* args)
{
int err, gbytes=0, bytes=0, ncache=0;
@@ -4076,6 +4091,7 @@ static PyMethodDef DBEnv_methods[] = {
#if (DBVER >= 40)
{"set_timeout", (PyCFunction)DBEnv_set_timeout, METH_VARARGS|METH_KEYWORDS},
#endif
+ {"set_shm_key", (PyCFunction)DBEnv_set_shm_key, METH_VARARGS},
{"set_cachesize", (PyCFunction)DBEnv_set_cachesize, METH_VARARGS},
{"set_data_dir", (PyCFunction)DBEnv_set_data_dir, METH_VARARGS},
#if (DBVER >= 32)