#include <mach/vm_prot.h> also included by <mach/mach.h>

mach/vm_prot.h

15 macros · 1 typedef

typedefvm_prot_t

typedef int vm_prot_t
CMU/MIT Mach reference · manual page · © Carnegie Mellon
Defined values:
VM_PROT_READAllows read access.
VM_PROT_WRITEAllows write access.
VM_PROT_EXECUTEAllows execute access.
VM_PROT_NO_CHANGEDo not change the protection of any pages.
VM_PROT_NONEProhibits no access (that is, all forms of access are permitted).
VM_PROT_ALLProhibits all forms of access.

macroVM_PROT_NONE

#define VM_PROT_NONE ((vm_prot_t) 0x00)
CMU/MIT Mach reference · manual page · © Carnegie Mellon
Prohibits no access (that is, all forms of access are permitted).
a value of vm_prot_t

macroVM_PROT_READ

#define VM_PROT_READ ((vm_prot_t) 0x01)
read permission
CMU/MIT Mach reference · manual page · © Carnegie Mellon
Allows read access.
a value of vm_prot_t

macroVM_PROT_WRITE

#define VM_PROT_WRITE ((vm_prot_t) 0x02)
write permission
CMU/MIT Mach reference · manual page · © Carnegie Mellon
Allows write access.
a value of vm_prot_t

macroVM_PROT_EXECUTE

#define VM_PROT_EXECUTE ((vm_prot_t) 0x04)
execute permission
CMU/MIT Mach reference · manual page · © Carnegie Mellon
Allows execute access.
a value of vm_prot_t

macroVM_PROT_DEFAULT

#define VM_PROT_DEFAULT (VM_PROT_READ|VM_PROT_WRITE)

macroVM_PROT_ALL

#define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE)
CMU/MIT Mach reference · manual page · © Carnegie Mellon
Prohibits all forms of access.
a value of vm_prot_t

macroVM_PROT_NO_CHANGE_LEGACY

#define VM_PROT_NO_CHANGE_LEGACY ((vm_prot_t) 0x08)

macroVM_PROT_NO_CHANGE

#define VM_PROT_NO_CHANGE ((vm_prot_t) 0x01000000)
CMU/MIT Mach reference · manual page · © Carnegie Mellon
Do not change the protection of any pages.
a value of vm_prot_t

macroVM_PROT_COPY

#define VM_PROT_COPY ((vm_prot_t) 0x10)

macroVM_PROT_WANTS_COPY

#define VM_PROT_WANTS_COPY ((vm_prot_t) 0x10)

macroVM_PROT_IS_MASK

Another invalid protection value. Indicates that the other protection bits are to be applied as a mask against the actual protection bits of the map entry.
#define VM_PROT_IS_MASK ((vm_prot_t) 0x40)

macroVM_PROT_STRIP_READ

Another invalid protection value to support execute-only protection. VM_PROT_STRIP_READ is a special marker that tells mprotect to not set VM_PROT_READ. We have to do it this way because existing code expects the system to set VM_PROT_READ if VM_PROT_EXECUTE is set. VM_PROT_EXECUTE_ONLY is just a convenience value to indicate that the memory should be executable and explicitly not readable. It will be ignored on platforms that do not support this type of protection.
#define VM_PROT_STRIP_READ ((vm_prot_t) 0x80)

macroVM_PROT_EXECUTE_ONLY

#define VM_PROT_EXECUTE_ONLY (VM_PROT_EXECUTE|VM_PROT_STRIP_READ)

macroVM_PROT_TPRO

Another invalid protection value to support pager TPRO protection. VM_PROT_TPRO is a special marker that tells the a pager to set TPRO flags on a given entry. We do it this way to prevent bloating the pager structures and it allows dyld to pass through this flag in lieue of specifying explicit VM flags, allowing us to handle the final permissions internally.
#define VM_PROT_TPRO ((vm_prot_t) 0x200)

macroVM_PROT_ALLEXEC

#define VM_PROT_ALLEXEC (VM_PROT_EXECUTE)