#include <oskit/svm/svm.h>int svm_protect(oskit_addr_t addr, oskit_size_t length, int prot);
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.
- 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 zero on success. Returns OSKIT_E_INVALIDARG if either the base address or the size of the allocation is not page aligned.
svm_alloc, svm_dealloc