Re: fork()

From: Naved A Surve (naved@bird.taponline.com)
Date: 12/19/95


In message <199512190953.AA170416795@elektron.et.tudelft.nl> you said:
> If fork() copies all memory from the parent proces to the child 
> proces how are pointers handled?
> Would they still point to the parents memory?

All modern operating systems use relative addressing, meaning that all
pointer addresses are relative to the start of the virtual address space of
the process.  When you fork, all the virtual addresses in the child are
mapped to new physical addresses.  This is, of course, disregarding
copy-on-write optimizations that might be in place.


Naved



This archive was generated by hypermail 2b30 : 12/07/00 PST