DB_MPOOLFILE->put()
Prev | Chapter 8. The DB_MPOOLFILE Handle | Next

## DB_MPOOLFILE->put()

    #include <db.h>

    int
    DB_MPOOLFILE->put(DB_MPOOLFILE *mpf,
        void *pgaddr, DB_CACHE_PRIORITY priority, u_int32_t flags);

The `DB_MPOOLFILE->put()` method returns a reference to a page in the cache, setting the priority of the page as specified by the priority parameter.

The `DB_MPOOLFILE->put()` method returns a non-zero error value on failure and 0 on success.

### Parameters

#### pgaddr

The pgaddr parameter is the address of the page to be returned to the cache. The pgaddr parameter must be a value previously returned by the DB_MPOOLFILE->get() method.

#### priority

Set the page's priority as follows:

- `DB_PRIORITY_UNCHANGED`

  The priority is unchanged.

- `DB_PRIORITY_VERY_LOW`

  The lowest priority: pages are the most likely to be discarded.

- `DB_PRIORITY_LOW`

  The next lowest priority.

- `DB_PRIORITY_DEFAULT`

  The default priority.

- `DB_PRIORITY_HIGH`

  The next highest priority.

- `DB_PRIORITY_VERY_HIGH`

  The highest priority: pages are the least likely to be discarded.

#### flags

The flags parameter is currently unused, and must be set to 0.

### Errors

The `DB_MPOOLFILE->put()` method may fail and return one of the following non-zero errors:

#### EINVAL

An invalid flag value or parameter was specified.

### Class

DB_ENV, DB_MPOOLFILE

### See Also

Memory Pools and Related Methods

Prev | Up | Next
DB_MPOOLFILE->open() | Home | DB_MPOOLFILE->sync()