Explain the purpose of the `dup_mmap` function in the `fork()` system call. How does it contribute to copying the parent’s address space to the child?
The dup_mmap() function is responsible for duplicating the memory mappings for the parent process to the child process. It is done by setting up the copy on write mechanism for the data and heap segments.