I would like to write a small program that demonstrates whether the operating system is using copy-on-write after a call to fork()
. The problem is that copy-on-write is mostly transparent to affected processes.
For a given variable, virtual memory addresses accessed with the &
operator appear identical for forked processes even when those processes store different values in that variable. Is there a way to determine if variables in separate processes are stored at the same physical address? Is there a way to determine if they are not?