Send data to parent process in Qt
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
Code:
int msgid = msgget(0x1234,IPC_CREAT|0666);
char str[50];
qDebug() << "waiting for msg ";
msgrcv(msgid,str,sizeof str,0,0);
if (!strcmp(str,"sender")){
/*do some processing */
}
from the child
Code:
int msgid = msgget(0x1234,IPC_CREAT|0666);
char str[]="sender";
qDebug() << "sending for msg ";
msgsnd(msgid,str,strlen(str)+1,0);
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.
Re: Send data to parent process in Qt
what does your code have to do with Qt?
Look at QProcess for reading standard / error output