I'm having a problem in shared memory that is : the project is to define number of ports and let these ports interconnect with each other, i must implement these ports by one of the inter-communication methods in ubuntu (pipes, shared memory, message queue and so on), so i decided to implement them as shared memory with number of segments equal to number of ports.I'm having a problem in shared memory that is :