01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.tomcat.jni;
19:
20: /** Mmap
21: *
22: * @author Mladen Turk
23: * @version $Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
24: */
25:
26: public class Mmap {
27: /** MMap opened for reading */
28: public static final int APR_MMAP_READ = 1;
29: /** MMap opened for writing */
30: public static final int APR_MMAP_WRITE = 2;
31:
32: /**
33: * Create a new mmap'ed file out of an existing APR file.
34: * @param file The file turn into an mmap.
35: * @param offset The offset into the file to start the data pointer at.
36: * @param size The size of the file
37: * @param flag bit-wise or of:
38: * <PRE>
39: * APR_MMAP_READ MMap opened for reading
40: * APR_MMAP_WRITE MMap opened for writing
41: * </PRE>
42: * @param pool The pool to use when creating the mmap.
43: * @return The newly created mmap'ed file.
44: */
45: public static native long create(long file, long offset, long size,
46: int flag, long pool) throws Error;
47:
48: /**
49: * Duplicate the specified MMAP.
50: * @param mmap The mmap to duplicate.
51: * @param pool The pool to use for new_mmap.
52: * @return Duplicated mmap'ed file.
53: */
54: public static native long dup(long mmap, long pool) throws Error;
55:
56: /**
57: * Remove a mmap'ed.
58: * @param mm The mmap'ed file.
59: */
60: public static native int delete(long mm);
61:
62: /**
63: * Move the pointer into the mmap'ed file to the specified offset.
64: * @param mm The mmap'ed file.
65: * @param offset The offset to move to.
66: * @return The pointer to the offset specified.
67: */
68: public static native long offset(long mm, long offset) throws Error;
69:
70: }
|