LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Creating more than one shared memory by a process (https://www.linuxquestions.org/questions/linux-software-2/creating-more-than-one-shared-memory-by-a-process-769286/)

anoopmenons 11-15-2009 09:23 AM

Creating more than one shared memory by a process
 
Hi all,

I am not sure whether more than one shared memory can be created by a process


I tried creating three shared memory by a process.
I am using shmget system call to create the shared memory.
The flag parameter what I am using is IPC_CREATE | 0666 for all the three.
I had also tried with IPC_CREATE | 0644

I am getting three different ids for shmget and three different pointers for shmat().But some junk value is coming in the shared memory created.

I doubt that the shared memory created is overlapping.Whether the flag parameter has to be changed.

Please clear my doubt

Regards.
anoopmenon

JohnGraham 11-15-2009 10:15 AM

Quote:

Originally Posted by anoopmenons (Post 3757799)
But some junk value is coming in the shared memory created.

What do you mean by this? Shared memory will probably contain garbage when you create it - that's nothing to worry about.

John G


All times are GMT -5. The time now is 06:25 AM.