If I fork and exec another executable, will the newly spawned process be able to access memory shared through mmap from the parent.
...
fd = open(filename)
str = mmap (MAP_SHARED, .. fd)
pid = fork();
if(pid == 0) {
exec("executable_2");
}
....
My question is, is it possible to access (read only) the shared memory mapped from file, from this spawned executable_2?
EDIT: the main purpose would be to save reading time (I/O) since this file is read-only. The newly spawned process is not a copy of the calling process.