When using shared memory in c, is it possible to first create data and then attach it to the shared segment (something like initialization)? Or must I first create the shared segment and then attach data to it?
I do think that both ways are correct, but I am not sure of what is exactly happening during calls to shmget
and shmat
. Do any of these calls, initialize the attached data?