Help I'm confused! From my readings on the Net and elsewhere it
would appear that the mmap system call is used to map a file into a
process's virtual memory, adding a new region to the address space. But
it seems also that this virtual mapping implies physical mapping if the
corresponding physical pages are not already loaded (by some other
process), except for the MAP_ANONYMOUS case.
If this is so how can we have a page in a process's address space
(virtual memory) that is not present in physical memory? Of course this
can happen after swapping but initially when loading a program how do
you create its address space (virtual memory) without having all the
regions in physical memory? i.e. How do you provide for demand-paging?
Any help appreciated.