change memory protection
#include <sys/mman.h> int mprotect( void *addr, size_t len, int prot );
The mprotect() function changes the access protections on any mappings residing in the range starting at addr, and continuing for len bytes.
The prot parameter specifies the new access capabilities to the mapped memory region(s). The bits that can be combined in this field are defined in sys/mman.h, and are described in “Header Files in /usr/include/sys” in the C Library Overview chapter.
On success the mprotect() function returns a value of zero. On error, a (-1) is returned and errno is set.
The memory object was not opened for write, and PROT_WRITE was specified for a MAP_SHARED type mapping.
The prot argument specifies PROT_WRITE on a MAP_PRIVATE mapping, and locking the private pages (if required) would need more space than the system can supply to reserve for doing so.
errno, mmap(), munmap(), shm_open(), shm_unlink()
POSIX 1003.4
QNX/32