A Bit About mmap

Points to Catch mmap()is system call used to maps files or devices into memory Linux provides the `mremap( ) system call for expanding or shrinking the size of a given mapping. POSIX defines the `mprotect( ) interface to allow programs to change the permissions of existing regions of memory. Synchronizing a File with a Mapping: A system call msync( ) flushes back to disk any changes made to a file mapped via mmap( ), synchronizing the mapped file with the mapping *Advantage of mmap() over open(), read()& write()` mmap is great if you have multiple processes accessing data in a read-only fashion from the same file which saves many system calls or context switching overheads Useful for inter-process communication....

September 10, 2016 · 3 min · 465 words · Vishal Chovatiya