microZEUS
The whole stack, hand-drawn.

◄ Wiki / OS

mmap

A system call that makes a file or a block of memory appear directly in a program's address space.

Instead of reading a file with explicit read calls, mmap maps it so the file's bytes act like an ordinary array in memory — the operating system loads pages on demand as you touch them. It's also used to grab fresh anonymous memory (backed by nothing on disk) for a program to use. This underpins efficient file access and much of how memory allocators get their raw space.

See also

  • mprotectA system call that changes what a program is allowed to do with a region of its memory — read, write, or execute.
  • pagingThe virtual-memory scheme that splits memory into fixed-size chunks and maps them flexibly.
  • page faultThe interrupt that fires when a program touches memory that isn't currently mapped in.

Referenced by

mprotect