| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Licensed to the Apache Software Foundation (ASF) under one or more | |
| 3 * contributor license agreements. See the NOTICE file distributed with | |
| 4 * this work for additional information regarding copyright ownership. | |
| 5 * The ASF licenses this file to You under the Apache License, Version 2.0 | |
| 6 * (the "License"); you may not use this file except in compliance with | |
| 7 * the License. You may obtain a copy of the License at | |
| 8 * | |
| 9 * 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 */ | |
| 24 public class Mmap { | |
| 25 /** MMap opened for reading */ | |
| 26 public static final int APR_MMAP_READ = 1; | |
| 27 /** MMap opened for writing */ | |
| 28 public static final int APR_MMAP_WRITE = 2; | |
| 29 | |
| 30 | |
| 31 /** | |
| 32 * Create a new mmap'ed file out of an existing APR file. | |
| 33 * @param file The file turn into an mmap. | |
| 34 * @param offset The offset into the file to start the data pointer at. | |
| 35 * @param size The size of the file | |
| 36 * @param flag bit-wise or of: | |
| 37 * <PRE> | |
| 38 * APR_MMAP_READ MMap opened for reading | |
| 39 * APR_MMAP_WRITE MMap opened for writing | |
| 40 * </PRE> | |
| 41 * @param pool The pool to use when creating the mmap. | |
| 42 * @return The newly created mmap'ed file. | |
| 43 */ | |
| 44 public static native long create(long file, long offset, long size, int flag
, long pool) | |
| 45 throws Error; | |
| 46 | |
| 47 /** | |
| 48 * Duplicate the specified MMAP. | |
| 49 * @param mmap The mmap to duplicate. | |
| 50 * @param pool The pool to use for new_mmap. | |
| 51 * @return Duplicated mmap'ed file. | |
| 52 */ | |
| 53 public static native long dup(long mmap, long pool) | |
| 54 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) | |
| 69 throws Error; | |
| 70 | |
| 71 } | |
| OLD | NEW |