Is it not possible to create two IPC shared memory segments from one process?
I am trying to create two shared memory from a single process one for sharing data with seperate process and other for shared with its child process. I am using shmget, i also tried to get the shared memory information in the system with ipcs. Output of which is something like this:
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x0beefbaf 0 root 666 225544 4
0x00000000 98305 root 666 4 0
Above output showed that two shared segment do get created, but shmget return only 0 as its output. Hence one shared memory segment is getting attached twice.
What is the problem with shmget or it is not possible to create two shared memory from one process.