1 .\" Copyright (c) 1990, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" SPDX-License-Identifier: BSD-4-Clause-UC
6 .\" @(#)mpool.3 8.1 (Berkeley) 6/4/93
8 .TH MPOOL 3 2021-03-22 "Linux man-pages (unreleased)"
11 mpool \- shared memory buffer pool
14 .RI ( libc ", " \-lc )
20 .BI "MPOOL *mpool_open(DBT *" key ", int " fd ", pgno_t " pagesize \
21 ", pgno_t " maxcache );
23 .BI "void mpool_filter(MPOOL *" mp ", void (*pgin)(void *, pgno_t, void *),"
24 .BI " void (*" pgout ")(void *, pgno_t, void *),"
25 .BI " void *" pgcookie );
27 .BI "void *mpool_new(MPOOL *" mp ", pgno_t *" pgnoaddr );
28 .BI "void *mpool_get(MPOOL *" mp ", pgno_t " pgno ", unsigned int " flags );
29 .BI "int mpool_put(MPOOL *" mp ", void *" pgaddr ", unsigned int " flags );
31 .BI "int mpool_sync(MPOOL *" mp );
32 .BI "int mpool_close(MPOOL *" mp );
36 This page documents interfaces provided in glibc up until version 2.1.
37 Since version 2.2, glibc no longer provides these interfaces.
38 Probably, you are looking for the APIs provided by the
43 is the library interface intended to provide page oriented buffer management
45 The buffers may be shared between processes.
49 initializes a memory pool.
52 argument is the byte string used to negotiate between multiple
53 processes wishing to share buffers.
54 If the file buffers are mapped in shared memory, all processes using
55 the same key will share the buffers.
58 is NULL, the buffers are mapped into private memory.
61 argument is a file descriptor for the underlying file, which must be seekable.
64 is non-NULL and matches a file already being mapped, the
70 argument is the size, in bytes, of the pages into which the file is broken up.
73 argument is the maximum number of pages from the underlying file to cache
75 This value is not relative to the number of processes which share a file's
76 buffers, but will be the largest value specified by any of the processes
81 function is intended to make transparent input and output processing of the
85 function is specified, it is called each time a buffer is read into the memory
86 pool from the backing file.
89 function is specified, it is called each time a buffer is written into the
91 Both functions are called with the
93 pointer, the page number and a pointer to the page to being read or written.
99 pointer and an address as arguments.
100 If a new page can be allocated, a pointer to the page is returned and
101 the page number is stored into the
104 Otherwise, NULL is returned and
112 pointer and a page number as arguments.
113 If the page exists, a pointer to the page is returned.
114 Otherwise, NULL is returned and
119 argument is not currently used.
123 unpins the page referenced by
126 must be an address previously returned by
130 The flag value is specified by ORing
131 any of the following values:
134 The page has been modified and needs to be written to the backing file.
137 returns 0 on success and \-1 if an error occurs.
141 writes all modified pages associated with the
146 returns 0 on success and \-1 if an error occurs.
150 function free's up any allocated memory associated with the memory pool
154 written to the backing file.
156 returns 0 on success and \-1 if an error occurs.
160 function may fail and set
162 for any of the errors specified for the library routine
167 function may fail and set
172 The requested record doesn't exist.
178 functions may fail and set
180 for any of the errors specified for the library routines
188 function may fail and set
190 for any of the errors specified for the library routine
195 function may fail and set
197 for any of the errors specified for the library routine