The Linux system call that maps files into memory is `mmap`.
`mmap(2)` creates a region in a process’s virtual address space corresponding to a file, device, or anonymous memory. The program can then access the region through ordinary memory operations instead of repeatedly calling read and write. File contents are generally loaded lazily through demand paging when the process first touches each page.
A file-backed mapping can be private or shared. With `MAP_PRIVATE`, changes are isolated from other processes and normally are not written back to the file. With `MAP_SHARED`, writes can become visible to other processes mapping the same file and can eventually reach the underlying storage; `msync` can request synchronization. Anonymous mappings, created with `MAP_ANONYMOUS`, are not backed by a file and are often used for dynamic memory or interprocess communication.
`open` obtains a file descriptor but does not map the file, while `read` and `write` transfer data explicitly. A mapping is typically released with `munmap`, and `mprotect` can change its access permissions. The API originated in BSD Unix and is now common across POSIX systems.