I have an application where i launched a process (using QProcess) , from this process i need to send a message to parent process.

from parent

Qt Code:
  1. int msgid = msgget(0x1234,IPC_CREAT|0666);
  2. char str[50];
  3. qDebug() << "waiting for msg ";
  4. msgrcv(msgid,str,sizeof str,0,0);
  5.  
  6. if (!strcmp(str,"sender")){
  7. /*do some processing */
  8. }
To copy to clipboard, switch view to plain text mode 

from the child

Qt Code:
  1. int msgid = msgget(0x1234,IPC_CREAT|0666);
  2. char str[]="sender";
  3. qDebug() << "sending for msg ";
  4. msgsnd(msgid,str,strlen(str)+1,0);
To copy to clipboard, switch view to plain text mode 



i am getting a msg "waiting for msg" and system is going to hang. what is the problem?

how else will pass msg from one process to other.

Thanks.