In the early versions of Unix system implementation, when a process called the fork() system call. It creates a child process, which is a copy of the parent process and has the copy of parent data space, heap and stack in the separate memory and there is no sharing except the code or text segment between the child and parent process.
But in current implementations, when fork() system called by a process; it does not performs the complete copy of data space, heap and stack. Instead, a technique called copy-on-write is used. In which both parent and child share these same region but the protection have changed read only by the kernel. when child tries to write, a page fault error is generated (does not show in the user space). which is handled by the kernel and a copy of page copied into the child process address space by the kernel and marked as writable.
Now my doubt is, when a child process called fork() system call and grand children try to write or modify, how will it work??