vmar_protect - set protection of virtual memory pages
#include <magenta/syscalls.h> mx_status_t mx_vmar_protect(mx_handle_t vmar_handle, uintptr_t addr, size_t len, uint32_t prot_flags);
vmar_protect() alters the access protections for the memory mappings in the range of len bytes starting from addr. The prot_flags argument should be a bitwise-or of one or more of the following:
If len is not page-aligned, it will be rounded up the next page boundary.
vmar_protect() returns MX_OK on success.
MX_ERR_BAD_HANDLE vmar_handle is not a valid handle.
MX_ERR_WRONG_TYPE vmar_handle is not a VMAR handle.
MX_ERR_INVALID_ARGS prot_flags is an unsupported combination of flags (e.g., PROT_WRITE but not PROT_READ), addr is not page-aligned, len is 0, or some subrange of the requested range is occupied by a subregion.
MX_ERR_NOT_FOUND Some subrange of the requested range is not mapped.
MX_ERR_ACCESS_DENIED vmar_handle does not have the proper rights for the requested change, the original VMO handle used to create the mapping did not have the rights for the requested change, or the VMAR itself does not allow the requested change.