mpool_open()

initialize memory pool 

Function


SYNOPSIS

#include <db.h>

#include <mpool.h>

MPOOL *mpool_open(DBT *key, int fd, pgno_t pagesize, pgno_t maxcache);


DESCRIPTION

The mpool_open() function initializes a memory pool. The specified key is a byte string used to negotiate between multiple processes wishing to share buffers. If the file buffers are mapped in shared memory, all processes using the same key share the buffers. If the specified key is NULL, the buffers are mapped into private memory.


PARAMETERS

key 

Is the key uses to coordinate access between multiple processes, or NULL for a private pool.

fd 

Is the file descriptor for the underlying file, which must be seekable. If key is non-NULL and matches a file already being mapped, the fd parameter is ignored.

pagesize 

Is the size, in bytes, of the pages into which the file is broken up.

maxcache 

Is the maximum number of pages from the underlying file to cache at any one time. This value is not relative to the number of processes which share a file's buffers, but is the largest value specified by any of the processes sharing the file.


RETURN VALUES

On success, mpool_open() returns a pointer to the memory pool. On error, it returns NULL, and sets errno to one of the conditions specified for malloc().


CONFORMANCE

4.4BSD.


MULTITHREAD SAFETY LEVEL

Unsafe.


PORTING ISSUES

Sharing of memory pools between processes is not currently supported. The key parameter is ignored, and the pool is created privately in the calling process.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
malloc(), mpool_close(), mpool_filter(), mpool_get(), mpool_new(), mpool_put(), mpool_sync()


PTC MKS Toolkit 10.5 Documentation Build 40.