1 .\" Copyright (c) 1990, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)mpool.3 8.1 (Berkeley) 6/4/93
34 .\" Japanese Version Copyright (c) 1999 Shouichi Saito
35 .\" all rights reserved.
36 .\" Translated Mon Jul 26 21:51:36 JST 1999
37 .\" by Shouichi Saito <ss236rx@ymg.urban.ne.jp>
38 .\" Proofed Tue Aug 19 1999 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
40 .\"WORD: descriptor デスクリプタ
41 .TH MPOOL 3 1993-06-04 "" "Linux Programmer's Manual"
44 .\"O mpool \- shared memory buffer pool
51 .BI "MPOOL *mpool_open(DBT *" key ", int " fd ", pgno_t " pagesize \
52 ", pgno_t " maxcache );
54 .BI "void mpool_filter(MPOOL *" mp ", void (*pgin)(void *, pgno_t, void *),"
55 .BI " void (*" pgout ")(void *, pgno_t, void *),"
56 .BI " void *" pgcookie );
58 .BI "void *mpool_new(MPOOL *" mp ", pgno_t *" pgnoaddr );
60 .BI "void *mpool_get(MPOOL *" mp ", pgno_t " pgno ", unsigned int " flags );
62 .BI "int mpool_put(MPOOL *" mp ", void *" pgaddr ", unsigned int " flags );
64 .BI "int mpool_sync(MPOOL *" mp );
66 .BI "int mpool_close(MPOOL *" mp );
70 .\"O is the library interface intended to provide page oriented buffer management
72 .\"O The buffers may be shared between processes.
74 は、ファイルに対するページ指向のバッファ管理を実装した
78 .\"O .BR mpool_open ()
79 .\"O initializes a memory pool.
85 .\"O argument is the byte string used to negotiate between multiple
86 .\"O processes wishing to share buffers.
87 .\"O If the file buffers are mapped in shared memory, all processes using
88 .\"O the same key will share the buffers.
90 引数はバイト文字列であり、バッファを共有したい複数プロセス間
92 ファイルバッファが共有メモリにマップされると、
93 同じキーを使うプロセスは全てバッファを共有する。
96 .\"O is NULL, the buffers are mapped into private memory.
98 が NULL だと、バッファはプライベートなメモリに割り付けられる。
101 .\"O argument is a file descriptor for the underlying file, which must be seekable.
103 引数はもとになるファイルのファイルデスクリプタである。
104 このファイルデスクリプタはシーク可能でなくてはならない。
107 .\"O is non-NULL and matches a file already being mapped, the
109 .\"O argument is ignored.
111 が NULL でなく、かつ既にマップされているファイルにマッチした場合、
117 .\"O argument is the size, in bytes, of the pages into which the file is broken up.
119 引数はバイト単位でのページサイズであり、ファイルはこのサイズに分割される。
122 .\"O argument is the maximum number of pages from the underlying file to cache
123 .\"O at any one time.
125 引数は基ファイルをキャッシュするときに用いる最大ページ数である。
126 .\"NAKANO "at any one time" は「どんな瞬間においても (最大)」ですが、
128 .\"O This value is not relative to the number of processes which share a file's
129 .\"O buffers, but will be the largest value specified by any of the processes
130 .\"O sharing the file.
131 この値はファイルバッファを共有しているプロセスの数には関係ないが、
132 ファイルを共有するプロセスが指定したうちの最大値が実際に用いられる。
135 .\"O .BR mpool_filter ()
136 .\"O function is intended to make transparent input and output processing of the
143 .\"O function is specified, it is called each time a buffer is read into the memory
144 .\"O pool from the backing file.
148 ファイルからメモリプールに読み込まれる度にこの関数が呼び出される。
151 .\"O function is specified, it is called each time a buffer is written into the
156 バッファからファイルに書き出される度にこの関数が呼び出される。
157 .\"O Both functions are called with the
159 .\"O pointer, the page number and a pointer to the page to being read or written.
162 ポインタ、ページ数、読み書きされるページへのポインタを引数にとる。
165 .\"O .BR mpool_new ()
168 .\"O pointer and an address as arguments.
174 .\"O If a new page can be allocated, a pointer to the page is returned and
175 .\"O the page number is stored into the
178 新しいページが割り当て可能な場合、ページへのポインタが返され、
182 .\"O Otherwise, NULL is returned and
185 割り当てが不可能な場合は NULL が返され、
190 .\"O .BR mpool_get ()
193 .\"O pointer and a page number as arguments.
194 .\"O If the page exists, a pointer to the page is returned.
195 .\"O Otherwise, NULL is returned and
200 .\"O argument is not currently used.
205 ポインタとページ数を引数にとる。ページが存在していると、
214 .\"O .BR mpool_put ()
215 .\"O unpins the page referenced by
223 .\"O must be an address previously returned by
224 .\"O .BR mpool_get ()
226 .\"O .BR mpool_new ().
233 .\"O The flag value is specified by ORing
234 .\"O any of the following values:
235 flag の値は以下の値の論理和で指定する。
238 .\"O The page has been modified and needs to be written to the backing file.
239 ページは変更されており、ファイルに書き出す必要がある。
241 .\"O .BR mpool_put ()
242 .\"O returns 0 on success and \-1 if an error occurs.
244 は成功すると 0 を、エラーがあると \-1 を返す。
247 .\"O .BR mpool_sync ()
248 .\"O writes all modified pages associated with the
258 .\"O .BR mpool_sync ()
259 .\"O returns 0 on success and \-1 if an error occurs.
261 は成功すると 0 を、エラーがあると \-1 を返す。
264 .\"O .BR mpool_close ()
265 .\"O function free's up any allocated memory associated with the memory pool
269 はメモリプールクッキーの示す割り当て済みのメモリを解放する。
270 .\"O Modified pages are
272 .\"O written to the backing file.
273 変更されたページはファイルに\fB書き出されない\fP。
274 .\"O .BR mpool_close ()
275 .\"O returns 0 on success and \-1 if an error occurs.
277 は成功すると 0 を、エラーがあると \-1 を返す。
280 .\"O .BR mpool_open ()
281 .\"O function may fail and set
283 .\"O for any of the errors specified for the library routine
294 .\"O .BR mpool_get ()
295 .\"O function may fail and set
297 .\"O for the following:
305 .\"O The requested record doesn't exist.
309 .\"O .BR mpool_new ()
311 .\"O .BR mpool_get ()
312 .\"O functions may fail and set
314 .\"O for any of the errors specified for the library routines
332 .\"O .BR mpool_sync ()
333 .\"O function may fail and set
335 .\"O for any of the errors specified for the library routine
346 .\"O .BR mpool_close ()
347 .\"O function may fail and set
349 .\"O for any of the errors specified for the library routine
358 .\"O .SH "CONFORMING TO"
360 .\"O Not in POSIX.1-2001.
361 .\"O Present on the BSDs.