


Kernel is permitted to relocate the mapping to a new virtual address, if necessary. MREMAP_MAYMOVE By default, if there is not sufficient space to expand a mapping at its current location, then mremap() fails. The flags bit-mask argument may be 0, or include the following flag: mremap() changes the mapping between virtual addresses and memory pages. Mremap() uses the Linux page table scheme. Accessing virtual memory outside of the segments will also cause a segmentation If the memory is accessed incorrectly (e.g., writing to a read-only segment). Each virtual memory segment has its own protection (access rights), which may cause a segmentation violation Mappings to real memory pages (in the page table). Each virtual memory segment has one or more A user process has (one or) several linear virtual memory segments. In Linux the memory is divided into pages. An optionalįifth argument, new_address, may be provided see the description of MREMAP_FIXED below.

new_size is the requested size of the virtual memory block after the resize. Old_size is the old size of the virtual memory block. Note that old_address has to be page aligned. Old_address is the old address of the virtual memory block that you want to expand (or shrink). (controlled by the flags argument and the available virtual address space). Mremap() expands (or shrinks) an existing memory mapping, potentially moving it at the same time
