[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1


disclaim Subroutine

Purpose

Disclaims the content of a memory address range.

Syntax

#include <sys/shm.h>


int disclaim ( Address, Length, Flag)
char *Address;
unsigned int Length, Flag;

Description

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

Parameters


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

Return Values

When successful, the disclaim subroutine returns a value of 0.

Error Codes

If the disclaim subroutine is unsuccessful, it returns a value of -1 and sets the errno global variable to indicate the error. The disclaim subroutine is unsuccessful if one or more of the following are true:

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.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]