head 1.2; access; symbols RPM_4_2_1:1.1.1.5 RPM_4_2:1.1.1.5 RPM_4_1_1:1.1.1.5 RPM_4_1:1.1.1.4 RPM_4_0_5:1.1.1.3 RPM_4_0_4:1.1.1.2 RPM_4_0_3:1.1.1.1 RPM:1.1.1; locks; strict; comment @# @; 1.2 date 2008.01.02.09.52.57; author rse; state dead; branches; next 1.1; commitid z4cpSiAhOCXk5PLs; 1.1 date 2001.07.23.20.45.36; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2001.07.23.20.45.36; author rse; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 2002.01.08.00.30.08; author rse; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 2003.01.18.13.48.57; author rse; state Exp; branches; next 1.1.1.4; 1.1.1.4 date 2001.12.06.00.07.59; author rse; state Exp; branches; next 1.1.1.5; 1.1.1.5 date 2003.01.18.14.04.57; author rse; state Exp; branches; next ; desc @@ 1.2 log @remove the ancient RPM 4.2.1 source tree copy @ text @
memp_register |
![]() ![]() |
#include <db.h>int memp_register(DB_ENV *env, int ftype, int (*pgin_fcn)(DB_ENV *, db_pgno_t pgno, void *pgaddr, DBT *pgcookie), int (*pgout_fcn)(DB_ENV *, db_pgno_t pgno, void *pgaddr, DBT *pgcookie));
The memp_register function registers page-in and page-out functions for files of type ftype in the specified pool.
If the pgin_fcn function is non-NULL, it is called each time a page is read into the memory pool from a file of type ftype, or a page is created for a file of type ftype (see the DB_MPOOL_CREATE flag for the memp_fget function).
If the pgout_fcn function is non-NULL, it is called each time a page is written to a file of type ftype.
Both the pgin_fcn and pgout_fcn functions are called with a reference to the current environment, the page number, a pointer to the page being read or written, and any argument pgcookie that was specified to the memp_fopen function when the file was opened. The pgin_fcn and pgout_fcn functions should return 0 on success, and an applicable non-zero errno value on failure, in which case the shared memory pool interface routine (and, by extension, any Berkeley DB library function) calling it will also fail, returning that errno value.
The purpose of the memp_register function is to support processing when pages are entered into, or flushed from, the pool. A file type must be specified to make it possible for unrelated threads or processes that are sharing a pool, to evict each other's pages from the pool. During initialization, applications should call memp_register for each type of file requiring input or output processing that will be sharing the underlying pool. (No registry is necessary for the standard Berkeley DB access method types because DB->open registers them separately.)
If a thread or process does not call memp_register for a file type, it is impossible for it to evict pages for any file requiring input or output processing from the pool. For this reason, memp_register should always be called by each application sharing a pool for each type of file included in the pool, regardless of whether or not the application itself uses files of that type.
There are no standard values for ftype, pgin_fcn, pgout_fcn, and pgcookie, except that the ftype value for a file must be a non-zero positive number because negative numbers are reserved for internal use by the Berkeley DB library. For this reason, applications sharing a pool must coordinate their values among themselves.
The memp_register function returns a non-zero error value on failure and 0 on success.
The memp_register function may fail and return a non-zero error for errors specified for other Berkeley DB and C library or system functions. If a catastrophic error has occurred, the memp_register function may fail and return DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail in the same way.
![]() ![]() |
Copyright Sleepycat Software @ 1.1 log @Initial revision @ text @d1 1 a1 1 @ 1.1.1.1 log @Import: RPM 4.0.3 @ text @@ 1.1.1.2 log @Import: RPM 4.0.4 @ text @d1 1 a1 1 d6 1 a6 1
The DB_ENV->memp_register function registers page-in and page-out d35 1 a35 1 DB_MPOOL_CREATE flag for the DB_MPOOLFILE->get function). d38 5 a42 5
Both the pgin_fcn and pgout_fcn functions are called with a reference to the current environment, the page number, a pointer to the page being read or written, and any argument pgcookie that was specified to the DB_MPOOLFILE->set_pgcookie function. The pgin_fcn and pgout_fcn functions should return 0 on d47 1 a47 1
The purpose of the DB_ENV->memp_register function is to support processing d51 1 a51 1 initialization, applications should call DB_ENV->memp_register for each d55 1 a55 1
If a thread or process does not call DB_ENV->memp_register for a file d58 1 a58 1 DB_ENV->memp_register should always be called by each application sharing d67 1 a67 1
The DB_ENV->memp_register function returns a non-zero error value on failure and 0 on success. d69 2 a70 2
The DB_ENV->memp_register function may fail and return a non-zero error for errors specified for other Berkeley DB and C library or system functions. If a catastrophic error has occurred, the DB_ENV->memp_register function may fail and return d76 9 a84 15 DB_ENV->memp_fcreate, DB_MPOOLFILE->close, DB_MPOOLFILE->get, DB_MPOOLFILE->open, DB_MPOOLFILE->put, DB_MPOOLFILE->set, DB_MPOOLFILE->sync, DB_ENV->memp_register, DB_MPOOLFILE->set_clear_len, DB_MPOOLFILE->set_fileid, DB_MPOOLFILE->set_ftype, DB_MPOOLFILE->set_lsn_offset, DB_MPOOLFILE->set_pgcookie, DB_ENV->memp_stat, DB_ENV->memp_sync, d86 1 a86 1 DB_ENV->memp_trickle. @ 1.1.1.3 log @Import: RPM 4.0.5 @ text @d1 2 a2 2 a3 1 d30 1 a30 1
The DB_ENV->memp_register method registers page-in and page-out d35 1 a35 1 DB_MPOOL_CREATE flag for the DB_MPOOLFILE->get method). d41 1 a41 1 that was specified to the DB_MPOOLFILE->set_pgcookie method. The d63 5 a67 5 value for a file must be a non-zero positive number less than 128 (0 and negative numbers are reserved for internal use by the Berkeley DB library). For this reason, applications sharing a pool must coordinate the values among themselves.
The DB_ENV->memp_register method returns a non-zero error value on failure and 0 on success. d69 4 a72 6
The DB_ENV->memp_register method may fail and return a non-zero error for errors specified for other Berkeley DB and C library or system functions. If a catastrophic error has occurred, the DB_ENV->memp_register method may fail and return DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail in the same way.
The DB_ENV->memp_register function registers page-in and page-out d36 1 a36 1 DB_MPOOL_CREATE flag for the DB_MPOOLFILE->get function). d42 1 a42 1 that was specified to the DB_MPOOLFILE->set_pgcookie function. The d64 5 a68 5 value for a file must be a non-zero positive number because negative numbers are reserved for internal use by the Berkeley DB library. For this reason, applications sharing a pool must coordinate their values among themselves.
The DB_ENV->memp_register function returns a non-zero error value on failure and 0 on success. d70 6 a75 4
The DB_ENV->memp_register function may fail and return a non-zero error for errors specified for other Berkeley DB and C library or system functions. If a catastrophic error has occurred, the DB_ENV->memp_register function may fail and return DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail in the same way. d77 1 a77 19 DB_ENV->set_cachesize, DB_ENV->set_mp_mmapsize, DB_ENV->memp_fcreate, DB_MPOOLFILE->close, DB_MPOOLFILE->get, DB_MPOOLFILE->open, DB_MPOOLFILE->put, DB_MPOOLFILE->set, DB_MPOOLFILE->sync, DB_ENV->memp_register, DB_MPOOLFILE->set_clear_len, DB_MPOOLFILE->set_fileid, DB_MPOOLFILE->set_ftype, DB_MPOOLFILE->set_lsn_offset, DB_MPOOLFILE->set_pgcookie, DB_ENV->memp_stat, DB_ENV->memp_sync, and DB_ENV->memp_trickle. @ 1.1.1.5 log @Import: RPM 4.1.1 @ text @d1 2 a2 2 a3 1 d30 1 a30 1
The DB_ENV->memp_register method registers page-in and page-out d35 1 a35 1 DB_MPOOL_CREATE flag for the DB_MPOOLFILE->get method). d41 1 a41 1 that was specified to the DB_MPOOLFILE->set_pgcookie method. The d63 5 a67 5 value for a file must be a non-zero positive number less than 128 (0 and negative numbers are reserved for internal use by the Berkeley DB library). For this reason, applications sharing a pool must coordinate the values among themselves.
The DB_ENV->memp_register method returns a non-zero error value on failure and 0 on success. d69 4 a72 6
The DB_ENV->memp_register method may fail and return a non-zero error for errors specified for other Berkeley DB and C library or system functions. If a catastrophic error has occurred, the DB_ENV->memp_register method may fail and return DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail in the same way.