next up previous contents index
Next: 18 POSIX Threads: liboskit_threads.a Up: 17.2 API reference Previous: 17.2.3 svm_dealloc: deallocate a

17.2.4 svm_protect: control the protection of a region of virtual memory

 

SYNOPSIS

#include <oskit/svm/svm.h>

int svm_protect(oskit_addr_t addr, oskit_size_t length, int prot);

DESCRIPTION

Change the page level protection on a region of memory. The region begins at addr and extends for length bytes. The base address must be page aligned, and the length must be an integral number of pages. The page level protection of each page in the region is set to prot. Unlike svm_dealloc, this routine may called on any region of memory, not just regions that were allocated with svm_alloc.

PARAMETERS

addr
The address of the region.
length
The size in bytes of the region.
prot
Page level protection of the new region, composed of SVM_PROT_READ and SVM_PROT_WRITE.

RETURNS

Returns zero on success. Returns OSKIT_E_INVALIDARG if either the base address or the size of the allocation is not page aligned.

RELATED INFORMATION

svm_alloc, svm_dealloc


University of Utah Flux Research Group