Hello,
I am trying to use a message queue for communication between two unrelated processes in Linux. I am aware that using a common key value will allow us to open the same message queue in both the unrelated processes. But the problem is that at times a key value corresponding to a message queue might already be used by some system utility. So I am using IPC_CREAT | IPC_EXEL flags to ensure that a new message queue is compulsorily created.
In case msgget() returns an error, I increment the key value and retry to create a new message queue, till it succeeds. Now, the problem is how do I communicate this successful key value to the other unrelated process which wants to operate on the same message queue.
Am I missing something? Has anyone faced similar issues before?