disclaim and disclaim64 Subroutines

Purpose

Disclaim the content of a memory address range.

Syntax

#include <sys/shm.h>
int disclaim ( Address,  Length, Flag)
char *Address;
unsigned int Length, Flag;

int disclaim64( Address, Length, Flag)
void *Address;
size_t Length;
unsigned long Flag;

Description

The disclaim and disclaim64 subroutines mark an area of memory having content that is no longer needed. The system then stops paging the memory area. These subroutines cannot be used on memory that is mapped to a file by the shmat subroutine.

Parameters

Item Description
Address Points to the beginning of the memory area.
Length Specifies the length of the memory area in bytes.
Flag Must be the DISCLAIM_ZEROMEM value, which indicates that each memory location in the address range should be set to zero.

Return Values

When successful, the disclaim and disclaim64 subroutines return a value of 0.

Error Codes

If the disclaim and disclaim64 subroutines are not successful, they returns a value of -1 and set the errno global variable to indicate the error. The disclaim and disclaim64 subroutines are not successful if one or more of the following are true:

Item Description
EFAULT The calling process does not have write access to the area of memory that begins at the Address parameter and extends for the number of bytes specified by the Length parameter.
EINVAL The value of the Flag parameter is not valid.
EINVAL The memory area is mapped to a file.