UNIX message queue msgrcv failed to receive message
问题 Dear Friends, Any idea why the msgrcv is receiving a blank buffer? Here is the code: enter code here #include <sys/msg.h> #include <unistd.h> #include <sys/types.h> #include <stdio.h> #include <string.h> typedef struct mymsg { long mtype; char mtext[24]; }mymsg; int main() { int msqid; mymsg msg,buff; msqid=msgget(IPC_PRIVATE,IPC_CREAT|IPC_EXCL); if(msqid==-1){ perror("FAiled to create message queue\n"); } else{ printf("Message queue id:%u\n",msqid); } msg.mtype=1; strcpy(msg.mtext,"This is a