Hi,

i have a structure named A. I use shmget and shmat to create shared memory first, then assign my object to it. After that i do some forks. So they heritage this id and pointer, which shmget and shmat gave me back. Here's a deal:

there is an array of char pointers in the structure A, which has been created in shared memory. Every process made with that fork can (or could would be a better word...) put some strings into that shared char pointers array. But to do that i must use malloc. And the question is is that malloc allocating memory in the shared memory area or what? I cannot see strings which has been put to that array by another process but comparing the adressess of every char pointer in array - they're the same! What's more, they interact some way with each other so when i put some data using one, the other gets the same data that he has put but a little disorted. So what's going on? Two different data written in the same adress? I'm running both from the same machine! How is that possible?


Thanks in advance,
Grzegorz