Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  *  Licensed to the Apache Software Foundation (ASF) under one or more
  *  contributor license agreements.  See the NOTICE file distributed with
  *  this work for additional information regarding copyright ownership.
  *  The ASF licenses this file to You under the Apache License, Version 2.0
  *  (the "License"); you may not use this file except in compliance with
  *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package org.apache.tomcat.jni;

Stdlib

Author(s):
Mladen Turk
Version:
$Revision: 515 $, $Date: 2008-03-17 22:02:23 +0100 (Mon, 17 Mar 2008) $
public class Stdlib {

    
Read from plain memory

Parameters:
dst Destination byte array
src Source memory address
sz Number of bytes to copy.
    public static native boolean memread(byte [] dstlong srcint sz);

    
Write to plain memory

Parameters:
dst Destination memory address
src Source byte array
sz Number of bytes to copy.
    public static native boolean memwrite(long dstbyte [] srcint sz);

    
Sets buffers to a specified character

Parameters:
dst Destination memory address
c Character to set.
sz Number of characters.
    public static native boolean memset(long dstint cint sz);

    
Allocates memory blocks.

Parameters:
sz Bytes to allocate.
    public static native long malloc(int sz);

    
Reallocate memory blocks.

Parameters:
mem Pointer to previously allocated memory block.
sz New size in bytes.
    public static native long realloc(long memint sz);

    
Allocates an array in memory with elements initialized to 0.

Parameters:
num Number of elements.
sz Length in bytes of each element.
    public static native long calloc(long numint sz);

    
Deallocates or frees a memory block.

Parameters:
mem Previously allocated memory block to be freed.
    public static native void free(long mem);

    
Get current process pid.

Returns:
current pid or < 1 in case of error.
    public static native int getpid();

    
Get current process parent pid.

Returns:
parent pid or < 1 in case of error.
    public static native int getppid();
New to GrepCode? Check out our FAQ X