Suppose we have requested shared memory and attached it to the main process of our program.
This program creates several processes. As the manual of shmat says
After a fork(2) the child inherits the attached shared memory segments.
So we don't have to attach the shared memory to the child processes.
But what about detaching it? Should we do it at the child's code as well?
Or just detaching the shared memory at the main process and destroying it is enough?