Skip to main content

SYS_MPROTECT

Constant SYS_MPROTECT 

Source
pub const SYS_MPROTECT: usize = 104;
Expand description

Change memory protection flags on a mapped region.

  • addr: start address (must be page-aligned)
  • len: length in bytes (rounded up to page boundary)
  • prot: new protection flags (PROT_READ, PROT_WRITE, PROT_EXEC)

Returns 0 on success. Common errors: -EACCES (trying to make a mapping executable that wasn’t created with PROT_EXEC).